finding last non empty cell in a column

  • Thread starter Thread starter cparsons
  • Start date Start date
C

cparsons

I am trying to find the last used cell in a column and then select tha
entire range. The activecell here is "B1". What is happening is th
column I am working in has a blank cells within the column so when thi
code runs it the selected range is from B1 down to the first blank cell
I need it to go all the way to the last used cell in the column.

Any suggestions?

Range(ActiveCell, ActiveCell.End(xlDown)).Select

Thanks,
Crai
 
Try this

Select B1 first

Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column).End(xlUp)).Select
 
Ron said:
Try this

Select B1 first

Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column).End(xlUp)).Select
Slightly more robust (watch for wordwrap); unlike the code above, this
makes the correct selection even if b65536 is not empty. As with the
above code, Select the cell in the first row first:

Range(ActiveCell, ActiveCell.EntireColumn.Find("*", ActiveCell, , , ,
xlPrevious)).Select

Alan Beban
 

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