Удаления всех пустых строк и столбцов на листе можно добиться следующим макросом:

Sub KillEmpty()

Dim r As Long, rng As Range

'сначала займемся пустыми строками

For r = 1 To ActiveSheet.UsedRange.Row - 1 + ActiveSheet.UsedRange.Rows.Count

If Application.CountA(Rows(r)) = 0 Then

If rng Is Nothing Then

Set rng = Rows(r) Else Set rng = Union(rng, Rows(r))

End If

Next r

If Not rng Is Nothing Then rng.Delete

'далее удаляются пустые столбцы

Set rng = Nothing

For r = 1 To ActiveSheet.UsedRange.Column - 1 + ActiveSheet.UsedRange.Columns.Count

If Application.CountA(Columns(r)) = 0 Then

If rng Is Nothing Then Set rng = Columns(r) Else Set rng = Union(rng, Columns(r))

End If

Next r

If Not rng Is Nothing Then rng.Delete

End Sub

 

Удалить пустые столбцы с листа можно и так:

Sub KillEmptyColumns()

LastCol = ActiveSheet.UsedRange.Column - 1 + ActiveSheet.UsedRange.Columns.Count

Application.ScreenUpdating = False

For r = LastCol To 1 Step -1

If Application.CountA(Columns(r)) = 0 Then Columns(r).Delete

Next r

End Sub