LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default How to delete sheets with "Ch" in the sheet name?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete all sheets in workbook that contain "Dump" in the name Porr via OfficeKB.com Excel Worksheet Functions 2 May 19th 10 10:25 PM
Excel "Move or Copy" and "Delete" sheet functions dsiama Excel Worksheet Functions 1 December 28th 07 01:57 PM
"With Sheets" Issue - macro on one sheet to affect hidden rows on other sheets Punsterr Excel Programming 3 February 21st 06 04:01 AM
Supress "delete sheets" warning Ron de Bruin Excel Programming 0 September 14th 04 08:59 PM
How2 Delete "Not exist" charts/sheets? fatfish[_4_] Excel Programming 4 July 22nd 04 02:17 PM


All times are GMT +1. The time now is 09:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"