Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Deleting All charts using VB


Hi Everyone,

Essentially I have made a program that produces charts as a new
worksheet (Chartsheet); however I have some code that works on the
number of worksheets produced and will mess up when more charts are
added. I cannot modify the code nor produce charts inside of a
worksheet but this will cause more problems.

My question:

Does anyone know a command in Visual Basic that deletes charts produced
as worksheets (chartsheet)?

-Identify a charts produced as a worksheets (tab)
-delete charts (without a specific tab name) (Ex. Chart 1, Chart
2…..ect)
-delete all charts without referring to their name.

Thanks


--
BrownTing
------------------------------------------------------------------------
BrownTing's Profile: http://www.excelforum.com/member.php...o&userid=34919
View this thread: http://www.excelforum.com/showthread...hreadid=560678

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Deleting All charts using VB

Try

Dim CH As Chart
Application.DisplayAlerts = False
For Each CH In ThisWorkbook.Charts
CH.Delete
Next CH
Application.DisplayAlerts = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"BrownTing"
wrote in
message
...

Hi Everyone,

Essentially I have made a program that produces charts as a new
worksheet (Chartsheet); however I have some code that works on
the
number of worksheets produced and will mess up when more charts
are
added. I cannot modify the code nor produce charts inside of a
worksheet but this will cause more problems.

My question:

Does anyone know a command in Visual Basic that deletes charts
produced
as worksheets (chartsheet)?

-Identify a charts produced as a worksheets (tab)
-delete charts (without a specific tab name) (Ex. Chart 1,
Chart
2...ect)
-delete all charts without referring to their name.

Thanks


--
BrownTing
------------------------------------------------------------------------
BrownTing's Profile:
http://www.excelforum.com/member.php...o&userid=34919
View this thread:
http://www.excelforum.com/showthread...hreadid=560678



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Deleting All charts using VB

Hi,

This will delete all chartsheets.

Activeworkbook.Charts.delete

Cheers
Andy

BrownTing wrote:
Hi Everyone,

Essentially I have made a program that produces charts as a new
worksheet (Chartsheet); however I have some code that works on the
number of worksheets produced and will mess up when more charts are
added. I cannot modify the code nor produce charts inside of a
worksheet but this will cause more problems.

My question:

Does anyone know a command in Visual Basic that deletes charts produced
as worksheets (chartsheet)?

-Identify a charts produced as a worksheets (tab)
-delete charts (without a specific tab name) (Ex. Chart 1, Chart
2…..ect)
-delete all charts without referring to their name.

Thanks



--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Deleting All charts using VB


thanks!!!

they both work


--
BrownTing
------------------------------------------------------------------------
BrownTing's Profile: http://www.excelforum.com/member.php...o&userid=34919
View this thread: http://www.excelforum.com/showthread...hreadid=560678

Reply
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
Deleting SeriesCollections in charts MAWII Excel Programming 2 August 22nd 05 05:00 PM
Charts should not be resized when deleting rows/columns. BobM Charts and Charting in Excel 1 February 11th 05 07:39 AM
Moving/deleting pictures within charts via macros Walshy[_3_] Excel Programming 1 October 21st 04 11:11 AM
Automatically Confirm Deleting Charts fatfish[_2_] Excel Programming 4 July 22nd 04 01:02 PM
Deleting charts on a sheet John Excel Programming 2 May 13th 04 05:15 AM


All times are GMT +1. The time now is 05:13 AM.

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

About Us

"It's about Microsoft Excel"