Select Data Range

  • Thread starter Thread starter alexrs2k
  • Start date Start date
A

alexrs2k

Wise forum, I have a range of data I want to select to perform some rutinary
tasks. I want to select only the data and not the whole sheet. I tried using
this:

Range("A2", "I" & Rows.Count).End(xlDown).Select

but it doesn't work. Can anybody tell me what is wrong? Thank you.
 
Assuming Excel 2003, Rows.Count will hold 65536, which means that
Range("A2", "I" & Rows.Count) will pick a full range, so End(xlDown) is just
not necessary.
 
Sub test()
Dim Lrow As Long
With ActiveSheet
Lrow = .Range("A" & Rows.Count).End(xlUp).Row
.Range("A2:I" & Lrow).Select
End With
End Sub

Note: you don't generally have to select something to operate on it.


Gord Dibben MS Excel MVP
 
That's the problem with that, I don't want all the rows just the ones that
have Data. How can I select only the data and leave the rest unselected?
 
Gord, you are the man. It worked out like "tube" as a friend of mine used to
say. THANK YOU!!!
 
Back
Top