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

Viewed 875

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?

1 Answers

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.

Related