Select range from ActiveCell do to Lastcell in ColumnA

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.
 
G

Gord Dibben

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
 
A

Aussie Bob C

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.
 
G

Gord Dibben

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
 
A

Aussie Bob C

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top