Reputation: 68
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
Reputation: 11978
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