开发者

Delete last / one specific row with what arguments?

开发者 https://www.devze.com 2023-03-23 11:47 出处:网络
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.

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
0

精彩评论

暂无评论...
验证码 换一张
取 消