View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default variable print area?


The worksheet and charts on the worksheet have
independent PageSetUp properties. The modified code
below adds the chart title text to the chart header.
It does not affect the header for the worksheet.
'-----------------------
Sub PrintAllCharts2()
Dim objChtObjects As Excel.ChartObjects
Dim objCht As Excel.ChartObject

Set objChtObjects = ActiveSheet.ChartObjects
For Each objCht In objChtObjects
With objCht.Chart
.PageSetup.CenterHeader = .ChartTitle.Text
.PrintOut
End With
Next
Set objCht = Nothing
Set objChtObjects = Nothing
End Sub
-----------
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"LadyReader"
wrote in message
Jim, that's a great answer. Right now I have:
Code:
--------------------
With ActiveSheet.PageSetup
.CenterHeader = "&26Chart 25"
.PrintTitleRows = ""
.PrintTitleColumns = ""
.CenterHorizontally = True
.CenterVertically = True
End With
--------------------

in my code. I'd like to set .CenterHeader dynamically so that the
printed page header is set to the chart title. Can you tell me how I
can address the chart title within your loop?
And the user may want to randomly select which charts to print so I am
working on a UI to allow the selection. Any ideas?
Thanks to all who responded!
LadyReader