View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
tony h
 
Posts: n/a
Default Deleting blank worksheets


try

Sub a()
Dim rng As Range
Dim wks As Worksheet

Application.DisplayAlerts = False
For Each wks In ThisWorkbook.Worksheets()
If wks.UsedRange.Cells.Count <= 1 Then
wks.Delete
End If
Next
Application.DisplayAlerts = True

End Sub


note that the count test is against a value of 1

Hope this helps


--
tony h
------------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074
View this thread: http://www.excelforum.com/showthread...hreadid=552065