Thread: Delete Sheets
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bre-x[_2_] Bre-x[_2_] is offline
external usenet poster
 
Posts: 8
Default Delete Sheets

I have this vba code that allows me to delete all the sheets but the one is
active.

Is there a way to delete all sheets but the ones "selected"??

workbook has 4 sheets: 1,2,3,4
If I select 2 and 3, delete 1 and 4

----------------------------------------
'Delete all but active sheet
For Each sheete In Sheets
If ActiveSheet.Index < sheete.Index Then
Application.DisplayAlerts = False
sheete.Delete
Application.DisplayAlerts = True
End If
Next sheete