3
votes

I have a spread sheet that will always be from Columns A to I but the range of the amount of rows can vary. I want to Select all cells in range (A1:I20000) until the first blank cell in column A, so if the data ends at 202 it will stop selecting the rows at line 202.

I tried writing my own formula but unfortunately columns B, C, E, and H continued to select down to row 20000

1

1 Answers

6
votes

Try this:

Sub hfjksaf()
    Dim N As Long
    N = Cells(1, 1).End(xlDown).Row
    Range("A1:I" & N).Select
End Sub

For example:

enter image description here