How do I select this range using code?

  • Thread starter Thread starter TBA
  • Start date Start date
T

TBA

Excel 2000
Windows 2k Pro


My StartCell is Range("B4").

My LastCell will be Range("E?") where the ? represents the last row
containing a value in either columns B through E.

-gk-
 
TBA,

Try this out:

range(range("B4"), Range("E" & Range("B4").CurrentRegion.Rows.count)).select

John
 
Although I am pretty sure someone comes up with a better way:
Sub SelectColumnE()
Dim B, E As Integer

Range("b65536").Select
Selection.End(xlUp).Select
B = Selection.Row

Range("e65536").Select
Selection.End(xlUp).Select
E = Selection.Row

If B >= E Then Range("e" & B).Select
If B < E Then Range("e" & E).Select

End Sub

Per Erik
 
Back
Top