Excel VBA select range at last row and column

前端 未结 3 933
甜味超标
甜味超标 2020-12-09 23:36

I\'m trying to create a macro that selects the range of last row and last column.

E.g. I want to select 1, 2, 3, 4 from my spreadsheet and then delete t

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-10 00:08

    The simplest modification (to the code in your question) is this:

        Range("A" & Rows.Count).End(xlUp).Select
        Selection.EntireRow.Delete
    

    Which can be simplified to:

        Range("A" & Rows.Count).End(xlUp).EntireRow.Delete
    

提交回复
热议问题