wie kann ich alle Tabellen löschen, die leer sind. Dabei sollen nicht nur
Zellen sondern auch Grafikobjekte berücksichtigt werden. Finde da keinen
Ansatz, wie ich das abfragen kann.
Schönen Sonntag Jochen
Sub DelEmptyTabs()
Dim lngCounter As Long
Dim wks As Worksheet
Application.DisplayAlerts = False
For Each wks In ActiveWorkbook.Worksheets
With wks
lngCounter = 0
On Error Resume Next
lngCounter = .Cells.SpecialCells(xlCellTypeConstants).Count
lngCounter = lngCounter + .Cells.SpecialCells(xlCellTypeAllFormatConditions).Count
lngCounter = lngCounter + .Cells.SpecialCells(xlCellTypeAllValidation).Count
lngCounter = lngCounter + .Cells.SpecialCells(xlCellTypeComments).Count
lngCounter = lngCounter + .Cells.SpecialCells(xlCellTypeConstants).Count
lngCounter = lngCounter + .Cells.SpecialCells(xlCellTypeFormulas).Count
lngCounter = lngCounter + .OLEObjects.Count
lngCounter = lngCounter + .Shapes.Count
If lngCounter = 0 Then .Delete
End With
Next
Application.DisplayAlerts = True
End Sub