jerryh91
jerryh91

Reputation: 1795

Delete last / one specific row with what arguments?

I'm trying to delete the last row of an Excel spreadsheet, but I don't know the format of the argument to put into the rows.delete command. It keeps giving me an error.

LastRow = Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByRows, SearchDirection:=xlPrevious)
Rows("LastRow").Delete 'error type mismatch

Any suggestions to the argument for rows.delete?

Upvotes: 0

Views: 152

Answers (2)

Dan
Dan

Reputation: 4663

Try this:

Range("a65536").End(xlUp).Select
Selection.EntireRow.Delete

Upvotes: 3

Lance Roberts
Lance Roberts

Reputation: 22842

LastRow.EntireRow.Delete  Shift:=xlShiftUp

Upvotes: 3

Related Questions