'删除空行
Sub DeleteEmptyRows()
Dim LastRow As Long, r As Long
LastRow = ActiveSheet.UsedRange.Rows.Count
LastRow = LastRow + ActiveSheet.UsedRange.Row - For r = LastRow To Step -
If WorksheetFunction.CountA(Rows(r)) = Then Rows(r).Delete
Next r End Sub
'删除空列
Sub DeleteEmptyColumns()
Dim LastColumn As Long, c As Long
LastColumn = ActiveSheet.UsedRange.Columns.Count
LastColumn = LastColumn + ActiveSheet.UsedRange.Column For c = LastColumn To Step -
If WorksheetFunction.CountA(Columns(c)) = Then Columns(c).Delete
Next c End Sub
05-20 22:08