3

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

mmariano
  • 41
  • 1
  • 1
  • 2

1 Answers1

7

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

Gary's Student
  • 95,722
  • 10
  • 59
  • 99