Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, I am after a piece of code that will delete all tabs regardless of names
and amounts after a certain tab. In this case the Tab is called Last Any ideas? Many thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This code will find the index number of the Sheet named "Last". Then it will
delete all the sheets after that sheet without giving you the message box alert. Hope this helps! If so, let me know, click "YES" below. Option Explicit Sub DeleteSheets() Dim LastSheet As Long Dim i As Long Application.DisplayAlerts = False LastSheet = Sheets("Last").Index + 1 For i = Sheets.Count To LastSheet Step -1 Sheets(i).Delete Next i Application.DisplayAlerts = True End Sub -- Cheers, Ryan "JohnUK" wrote: Hi, I am after a piece of code that will delete all tabs regardless of names and amounts after a certain tab. In this case the Tab is called Last Any ideas? Many thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Fantastic!!
Many thanks Ryan "Ryan H" wrote: This code will find the index number of the Sheet named "Last". Then it will delete all the sheets after that sheet without giving you the message box alert. Hope this helps! If so, let me know, click "YES" below. Option Explicit Sub DeleteSheets() Dim LastSheet As Long Dim i As Long Application.DisplayAlerts = False LastSheet = Sheets("Last").Index + 1 For i = Sheets.Count To LastSheet Step -1 Sheets(i).Delete Next i Application.DisplayAlerts = True End Sub -- Cheers, Ryan "JohnUK" wrote: Hi, I am after a piece of code that will delete all tabs regardless of names and amounts after a certain tab. In this case the Tab is called Last Any ideas? Many thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2002: Can I delete tabs at one go ? | Excel Discussion (Misc queries) | |||
Not a novice - can't delete tabs! | Excel Discussion (Misc queries) | |||
Delete Tabs | Excel Programming | |||
Delete Tabs | Excel Programming | |||
Macro to force delete tabs | Excel Programming |