Thread: Delete Tabs
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Delete Tabs

Sub ABCD()
Dim i As Long
Application.DisplayAlerts = False
For i = Sheets.Count To 2 Step -1
Sheets(i).Delete
Next
Application.DisplayAlerts = True

End Sub


--
Regards,
Tom Ogilvy




"Ardy" wrote in message
ps.com...
If I create 5 tabs based on some variables in one other tab, how would
I delete the created tabs.
i.e
I have TAB 1, in this tab I have code (Thanks to this group) I will
create TAB 2, 3, 4, 5. The numbers of tabs are unknown it depends on
the list on tab 1. I need to delete tab 2, 3, 4, 5 but not 1. So the
code I assume needs to make a list of all existing tabs have an
exception not to delete 1 and delete the rest.

Ardy