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:=xlP开发者_开发百科revious)
Rows("LastRow").Delete 'error type mismatch
Any suggestions to the argument for rows.delete?
Try this:
Range("a65536").End(xlUp).Select
Selection.EntireRow.Delete
LastRow.EntireRow.Delete Shift:=xlShiftUp
精彩评论