Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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:


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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:


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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.


.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select range from ActiveCell do to Lastcell Aussie Bob C Excel Programming 6 March 15th 10 07:40 AM
Select range of cells in column AS based upon lastcell in col A. jonnybrovo815 Excel Programming 2 November 19th 09 05:21 PM
ActiveCell.Row in Range().Select? thebluerider Excel Programming 1 August 19th 06 11:40 AM
select range next to activecell lookin Excel Programming 3 March 29th 06 07:56 PM
Select Activecell in Range PraxisPete Excel Programming 0 June 1st 05 01:23 PM


All times are GMT +1. The time now is 02:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"