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

Range("A10:M" & Range("A10000").End(xlUp).Row.Cut
will cut a range from Cell A10 across to Column M and down to last cell in
Column A
How do you replace reference to Cell A10 with ActiveCell in Column A?

--
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: 3,355
Default Select range from ActiveCell do to Lastcell in ColumnA

Dim lRow as long
Dim myRange as Excel.range
Dim aWS as excel.worksheet

set aWS = activesheet
Set myRange = aws.Range("A10")
lRow = aws.cells(aws.rows.count,myrange.row).end(xlup).ro w
set myrange = myrange.resize(lrow-myrange.row + 1,13)
debug.print myrange.address


--
HTH,

Barb Reinhardt



"Aussie Bob C" wrote:

Range("A10:M" & Range("A10000").End(xlUp).Row.Cut
will cut a range from Cell A10 across to Column M and down to last cell in
Column A
How do you replace reference to Cell A10 with ActiveCell in Column A?

--
Thank you

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Select range from ActiveCell do to Lastcell in ColumnA

My mention of cell A10 was an example used in the code.
The ActiveCell could be any Column A cell the user selects.
The range selected from ActiveCell down to last cell containing data in
Column A and include cells straight across to Column M.
Column M may be shorter than A but never longer.
My problem is coding a substitute an ActiveCell for A10 in codecode.
--
Thank you

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


"Barb Reinhardt" wrote:

Dim lRow as long
Dim myRange as Excel.range
Dim aWS as excel.worksheet

set aWS = activesheet
Set myRange = aws.Range("A10")
lRow = aws.cells(aws.rows.count,myrange.row).end(xlup).ro w
set myrange = myrange.resize(lrow-myrange.row + 1,13)
debug.print myrange.address


--
HTH,

Barb Reinhardt



"Aussie Bob C" wrote:

Range("A10:M" & Range("A10000").End(xlUp).Row.Cut
will cut a range from Cell A10 across to Column M and down to last cell in
Column A
How do you replace reference to Cell A10 with ActiveCell in Column A?

--
Thank you

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Select range from ActiveCell do to Lastcell in ColumnA

Range(ActiveCell, "M" & Cells(Rows.Count, "A").End(xlUp).Row).Cut

OR if the active cell is not in ColA

Range("A" & ActiveCell.Row & ":M" & Cells(Rows.Count, "A").End(xlUp).Row).Cut


--
Jacob


"Aussie Bob C" wrote:

Range("A10:M" & Range("A10000").End(xlUp).Row.Cut
will cut a range from Cell A10 across to Column M and down to last cell in
Column A
How do you replace reference to Cell A10 with ActiveCell in Column A?

--
Thank you

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

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 in ColumnA Aussie Bob C Excel Programming 4 March 16th 10 04:07 AM
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 Activecell in Range PraxisPete Excel Programming 0 June 1st 05 01:23 PM


All times are GMT +1. The time now is 12:59 PM.

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"