Sub
删除选区空白单元格()
On
Error
Resume
Next
Dim
r
As
Range, tmp
As
Range
Set
r = Intersect(ActiveSheet.UsedRange, Selection)
Application.ScreenUpdating =
False
For
i = r.Cells.Rows.Count
To
1
Step
-1
For
j = 1
To
r.Cells.Columns.Count
Set
tmp = r.Cells(i, j)
If
tmp =
""
Then
tmp.Delete xlUp
End
If
Next
j
Next
i
Application.ScreenUpdating =
True
End
Sub