Eduards
Eduards

Reputation: 68

VBA Range using Active.cell.column and range of rows

I have a statement:

Range("C4:C6").Value = "No"

And I need the column letter to be defined using.ActiveCell.Column and all is fine when I have a range of one specific row, which would be like:

Cells(4, ActiveCell.Column).Value = "No"

But how do I write "Range("C4:C6")" in the same manner as code above that has .activecell.column

Hope someone can help me?

Upvotes: 3

Views: 4542

Answers (1)

Try:

Range(Cells(4, ActiveCell.Column),Cells(6, ActiveCell.Column)).Value = "No"

This would be equivalent to range starting at row 4 and ending in whatever column is Activecell, but row 6.

Upvotes: 3

Related Questions