Reputation: 11
I want to select a range which takes in all data in a column (not including the header) that contains an unknown number of blank cells. I tried:
Columns("E:E").Select
Range(Selection, Selection.End(xlUp)).Offset(1).Select
However it doesn't seem to be working. Any Suggestions?
Upvotes: 0
Views: 1782
Reputation: 476
Try this
Range("E2:E" & Cells.SpecialCells(xlCellTypeLastCell).Row).Select
You could, of course, add a variable in place of the E
if you wish, but this will highlight from Row 2 down to as far as you have data entered.
Upvotes: 0
Reputation: 96753
Consider:
Sub dural()
Dim cl As String
cl = "E"
N = Cells(Rows.Count, cl).End(xlUp).Row
Range(cl & "2:" & cl & N).Select
End Sub
Upvotes: 1