![]() |
Select range from ActiveCell do to Lastcell in ColumnA
-- Thank you Aussie Bob C Little cost to carry knowledge with you. Win XP P3 Office 2007 on Mini Mac using VMware. |
Select range from ActiveCell do to Lastcell in ColumnA
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 On Mon, 15 Mar 2010 15:23:02 -0700, Aussie Bob C wrote: |
Select range from ActiveCell do to Lastcell in ColumnA
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. "Gord Dibben" wrote: 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 On Mon, 15 Mar 2010 15:23:02 -0700, Aussie Bob C wrote: . |
Select range from ActiveCell do to Lastcell in ColumnA
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 On Mon, 15 Mar 2010 17:06:01 -0700, Aussie Bob C wrote: Hi Gordon Sorry about double post. I require the range to include across to Column M. My second post states that. |
Select range from ActiveCell do to Lastcell in ColumnA
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. "Gord Dibben" wrote: 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 On Mon, 15 Mar 2010 17:06:01 -0700, Aussie Bob C wrote: Hi Gordon Sorry about double post. I require the range to include across to Column M. My second post states that. . |
All times are GMT +1. The time now is 07:39 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com