Selecting a range

P

PCOR

The code
Range("A2:A34").Select
will select A2 to a34
What code is required to select A1 to the last entry in Col A
Thanks
 
R

Rob van Gelder

With Worksheets(1): Range(.Cells(1, 1), .Cells(Rows.Count,
1).End(xlUp)).Select: End With
 
G

Gord Dibben

PCOR

Sub selectrange2()
''from top of column A to bottom of used range in column A including blanks
Range("A1", Cells(Rows.Count, 1).End(xlUp)).Select
End Sub

Sub selectrange1()
''from activecell in any column to bottom of used range in column including
''blanks
Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column).End(xlUp)).Select
End Sub

Sub SelectDown()
''to first blank row in active column
Range(ActiveCell, ActiveCell.End(xlDown)).Select
End Sub

Gord Dibben Excel MVP
 
P

PCOR

Many Thanks
Have a great 2004
PCOR

Sub selectrange2()
''from top of column A to bottom of used range in column A including blanks
Range("A1", Cells(Rows.Count, 1).End(xlUp)).Select
End Sub

Sub selectrange1()
''from activecell in any column to bottom of used range in column including
''blanks
Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column).End(xlUp)).Select
End Sub

Sub SelectDown()
''to first blank row in active column
Range(ActiveCell, ActiveCell.End(xlDown)).Select
End Sub

Gord Dibben Excel MVP
 
Top