VBA实例:删除空白行( 二 )

t = Timer

Dim i As Long

For i = 1000 To 1 Step -1

If Cells(i 1) = \"\" Then

Cells(i 1).EntireRow.Delete

End If

Next

MsgBox Format(Timer - t \"程序执行时间为:0.00秒\") 64 \"时间统计\"

End Sub

方法1程序运行时间:

方法2:

Sub 删除2()

Dim t

t = Timer

Sheet3.Columns(\"a\").SpecialCells(xlCellTypeBlanks).EntireRow.Delete

MsgBox Format(Timer - t \"程序执行时间为:0.00秒\") 64 \"时间统计\"

推荐阅读