View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sandy Sandy is offline
external usenet poster
 
Posts: 156
Default delete all sheets but one

Sub DeleteAll()
Dim ws As Worksheet
Application.DisplayAlerts = False
For Each ws In Worksheets
If Not ws Is ActiveSheet Then
ws.Delete
End If
Next
Application.DisplayAlerts = True
End Sub


Sandy

hans wrote:
Is there a way to delete all sheets but the active one?

Thanks Hans