Select range from ActiveCell do to Lastcell in ColumnA

A

Aussie Bob C

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

Barb Reinhardt

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).row
set myrange = myrange.resize(lrow-myrange.row + 1,13)
debug.print myrange.address
 
A

Aussie Bob C

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

Jacob Skaria

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
 

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