Delete rows after used cell?

J

JayL.

Good day,
I have a spreadsheet where I need to delete all the rows after the last used
cell in column B. How can I do this in a macro?

TIA
 
J

J.E. McGimpsey

One way:

With Cells(Rows.Count, 2)
Range(.End(xlUp).Offset(1, 0), .Cells).EntireRow.Delete
End With
 

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