Setting a range with the last used cell?

  • Thread starter Thread starter andycharger
  • Start date Start date
A

andycharger

Simple answer im sure but it is Friday!!!!

Hi,

Im trying to select a range.

i.e Range("A1:A23456").select

however, the last cell will change as the range grows. I need to fin
the last used cell for my range to replace A23456 everytime I run th
macro.

Can someone quickly write me the code to find the last cell for m
range?

Cheers.

And
 
Andy,
Try UsedRange it returns A1 to the bottom right of the
active sheet

Trev
 
andy

Sub selectrange2()
''from top of column A to bottom of used range in column A including blanks
Range("A1").Select
Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column).End(xlUp)).Select
End Sub


Sub selectrange1()
''from activecell in any column to bottom of used range in column including
''blanks
Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column).End(xlUp)).Select
End Sub

Gord Dibben Excel MVP
 

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

Back
Top