📜  excel vba删除空行 - VBA代码示例

📅  最后修改于: 2022-03-11 14:51:57.542000             🧑  作者: Mango

代码示例2
' Deletes empty rows
dim rRange As Range, rowsCount As Long, i As Long
Set rRange = ActiveSheet.Range("A1:B100")
rowsCount = rRange.rows.Count
For i = rowsCount To 1 Step -1
    If WorksheetFunction.CountA(rRanges.rows(i)) = 0 Then 
        rRange.rows(i).Delete
    End If
Next