Posted to microsoft.public.excel.programming
|
|
Deleting multiple Chart Tabs/sheets
To be extremely pedantic, sorry <g, sht.Type = 3 could also be Macro sheet.
Regards,
Peter T
"Nick Hodge" wrote in message
...
Chuck
Your question is a little ambiguous as you say it creates 37charts but you
want to delete 1 to 50. If it is ALL chart sheets you want to delete the
code below will do it
Sub DeleteChartSheets()
Dim sht As Object
Application.DisplayAlerts = False
For Each sht In ThisWorkbook.Sheets
If sht.Type = 3 Then sht.Delete
Next sht
Application.DisplayAlerts = True
End Sub
--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS
"CLR" wrote in message
...
Hi All......
I am working on a program that creates 37 different Charts. Each gets
created as it's own sheet/tab. I never know how many will be
created/deleted
during the course of a session. When the session is complete, I would
like a
macro to delete all Chart Tab/sheets, regardless of their "Chart 22" or
"Chart 12" numbers which Excel assigns them....I would like it to delete
all
existing Chart/tab between numbers 1 and 50 inclusive, but NOT non-chart
tabs/sheets. Recording the macro, just don't seem to get me
there.......any
help would be much appreciated.
TIA
Vaya con Dios,
Chuck, CABGx3
|