Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If they are charts, then they are chart sheets, not worksheets. Worksheets
have rows and columns and cells and stuff. Semantics aside, use the first to delete all chart sheets, or the second to delete those with names containing "ch" Sub DeleteAllChartSheets() Application.DisplayAlerts = False ' suppress warning message ActiveWorkbook.Charts.Delete Application.DisplayAlerts = True End Sub Sub DeleteChartSheetsNamed_CH_() Dim ch As Chart For Each ch In ActiveWorkbook If InStr(LCase$(ch.Name), "ch") 0 Then ch.Delete End If Next End Sub - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "Terry" wrote in message ... I need to delete all worksheets with name contains "Ch", from "Ch1" until "Ch(n)". How to do it? All these sheets are charts. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete all sheets in workbook that contain "Dump" in the name | Excel Worksheet Functions | |||
Excel "Move or Copy" and "Delete" sheet functions | Excel Worksheet Functions | |||
"With Sheets" Issue - macro on one sheet to affect hidden rows on other sheets | Excel Programming | |||
Supress "delete sheets" warning | Excel Programming | |||
How2 Delete "Not exist" charts/sheets? | Excel Programming |