Embedded Chart Window Title?

  • Thread starter Thread starter Ken
  • Start date Start date
K

Ken

I have 5 Tab sheets ... Each with 1 embedded chart ...
When I open a Chart Window ... Two of the embedded charts
are Titled "Chart 2" & Three are Titled "Chart 1" ...

I have a recorded Macro to Print_ALL_Charts ... Issue is:
Macro is calling for "Chart 1" & therefore stalls out when
it hits a chart titled "Chart 2" ...

I would like all Chart Titles to be "Chart 1" ... so Macro
won't fail ...

How do I accomplish this? ... Thanks ... Kha
 
Ken -

Forget the names of the charts. This macro ought to help.

Sub PrintAllCharts()
Dim WS as Worksheet
Dim CS as Chart
Dim ChtO as Chart Object
'' loop thru all worksheets
For Each WS in ActiveWorkbook.Worksheets
'' do all the embedded charts
For Each ChtO in WS.ChartObjects
ChtO.Chart.Printout
Next
Next
'' loop through all chart sheets
For Each CS in ActiveWorkbook.Charts
CS.Printout
'' chart sheets can have embedded charts too
For Each ChtO in CS.ChartObjects
ChtO.Chart.Printout
Next
Next
End Sub

- Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top