EntireRow.Delete performance issue

后端 未结 2 1510
无人共我
无人共我 2020-12-01 23:07

I am trying to delete all rows with blanks values. I have about 15,000 rows and no more than 25% are blank. Here is the code I have.

Columns(\"A:A\").Select          


        
2条回答
  •  孤城傲影
    2020-12-01 23:31

    Your code is running on ALL rows on the spreadsheet; it would be quicker to run it on the used rows.

    Something like this:

    Range("A1", Cells(Sheet1.Rows.Count, 1).End(xlUp).Address).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    

    Or, could you just sort the data range - that'd group all the blanks together...

提交回复
热议问题