Delete rows after used cell?

  • Thread starter Thread starter JayL.
  • Start date Start date
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
 
One way:

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