set range to bottom of sheet

  • Thread starter Thread starter ranswrt
  • Start date Start date
R

ranswrt

I have the following code to set a range to the bottom of the sheet:

Set rng7 = Range(xcell.Offset(71, -2), xcell.Offset(65000, -2)).EntireRow

I know there is a way to set it to the very bottom of the sheet, but I can't
find it. How do I do this?
Thanks
 
Sub dural()
Set r = Range("A" & Rows.Count).EntireRow
r.Select
End Sub

will select the last row of a worksheet (both 2007 and prior versions)
 
Hi

This will take set rng7 = last row with data, if all rows have data in
the "xcell" column.


LastRow = xcell.End(xlDown).Row ' I assume xCell is a range
Set rng7 = Rows(LastRow)

Regards,
Per
 

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

Similar Threads

naming multiple ranges 3
Listbox problem agaie 3
find 2
Listbox problems 1
error 5
intersect 12
Validation Error 4
Want code to copy to ABOVE row 22 column A on sheet 1 10

Back
Top