Select range from ActiveCell do to Lastcell in ColumnA

  • Thread starter Thread starter Aussie Bob C
  • Start date Start date
A

Aussie Bob C

--
Thank you

Aussie Bob C
Little cost to carry knowledge with you.
Win XP P3 Office 2007 on Mini Mac using VMware.
 
Sub rangefinder()
Dim rng As Range
Set rng = Range(ActiveCell, Cells(Rows.Count, 1).End(xlUp))
MsgBox rng.Address

'do something with rng

End Sub


Gord Dibben MS Excel MVP
 
Hi Gordon

Sorry about double post.
I require the range to include across to Column M.
My second post states that.
--
Thank you

Aussie Bob C
Little cost to carry knowledge with you.
Win XP P3 Office 2007 on Mini Mac using VMware.
 
Note that you don't generally have to select something to work on it.

I'm just selecting for clarity.

This macro selects A to M from activecell row and down to last row.

Does not matter which column has activecell.

Sub rangefinder()
Dim rng As Range
Dim lRow As Long
Set rng = Range(ActiveCell, Cells(Rows.Count, 1).End(xlUp))
rng.Resize(, 13).Select
End Sub

This macro selects from activecell in Column A to M and down to lastrow.

Sub rangefinder22()
Dim lRow As Long
With ActiveSheet
lRow = .Range("A" & Rows.Count).End(xlUp).Row
.Range(ActiveCell.Address & ":M" & lRow).Select
End With
End Sub


Gord
 
Gord
Thank you for your 2nd post
Sorry again for my second post.
It's a pity a poster can't edit his own post within say the first 15 minutes.
Then after that 15 minutes the post appears in the main question list.
i.e. a small lag time.

--
Thank you

Aussie Bob C
Little cost to carry knowledge with you.
Win XP P3 Office 2007 on Mini Mac using VMware.
 
Back
Top