B
Bre-x
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
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