A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Give multiple charts on a worksheet/workbook same header or footer



 
 
Thread Tools Display Modes
  #1  
Old June 30th, 2005, 02:35 PM
Ches
external usenet poster
 
Posts: n/a
Default Give multiple charts on a worksheet/workbook same header or footer

Using Excel 2003, SP1

I'm creating many charts throughout a large workbook that has many
worksheets, and there are several charts on each worksheet. It is a pain to
set the header and footer individually for each chart.

Can I group these charts together (possibly only in the active worksheet at
any one time) to give them all the same header and footer, as I can group
worksheets together in a workbook, to give them all the same header and
footer?

TIA
  #2  
Old July 4th, 2005, 04:44 PM
Tushar Mehta
external usenet poster
 
Posts: n/a
Default

Have you tried it? If it didn't work, you might consider recording a
macro to do the needful. Select a chart. Then, record a macro with
Tools | Macro Record new macro... Do whatever you want with the
chart, then turn off the macro recorder. Now, select any other chart
and run the macro (Alt+F8 or Tools | Macro Macros...)

A cautionary note. I vaguely recall a discussion that macros that
change the print setup run very slowly and there may also be a memory
leak that causes XL to run increasingly slowly as the code is repeated.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Using Excel 2003, SP1

I'm creating many charts throughout a large workbook that has many
worksheets, and there are several charts on each worksheet. It is a pain to
set the header and footer individually for each chart.

Can I group these charts together (possibly only in the active worksheet at
any one time) to give them all the same header and footer, as I can group
worksheets together in a workbook, to give them all the same header and
footer?

TIA

  #3  
Old July 4th, 2005, 04:58 PM
Ches
external usenet poster
 
Posts: n/a
Default

I've built on all the advice received to date to construct the following
macro, which changes the header or footer on all charts (special thanks to
Debra Dalgleish for the basis)

footer:
==========================================
Sub ChartFooters()

Dim ws As Worksheet
Dim chObj As ChartObject
Dim ch As Chart

For Each ws In ActiveWorkbook.Worksheets
For Each chObj In ws.ChartObjects
With chObj.Chart.PageSetup
.LeftFooter = "&8" & "Prepared by yourname yourdate"
.RightFooter = "&8" & "Printed &T on &D"
End With
Next chObj
Next ws

For Each ch In ActiveWorkbook.Charts
With ch.PageSetup
.LeftFooter = "&8" & "Prepared by yourname yourdate"
.RightFooter = "&8" & "Printed &T on &D"
End With
Next ch

End Sub
================================================== =

and for the headers
================================================== =



Sub ChartHeaders()

Dim ws As Worksheet
Dim chObj As ChartObject
Dim ch As Chart

For Each ws In ActiveWorkbook.Worksheets
For Each chObj In ws.ChartObjects
With chObj.Chart.PageSetup
.LeftHeader = "&8 " & Application.ActiveWorkbook.FullName
.RightHeader = "&A"
End With
Next chObj
Next ws

For Each ch In ActiveWorkbook.Charts
With ch.PageSetup
.LeftHeader = "&8 " & Application.ActiveWorkbook.FullName
.RightHeader = "&A"
End With
Next ch

End Sub

================================================== ====


Next question: how can I print date in long form (i.e. dddd, mmm dd, yyyy)
in place of &D which returns 04/07/2005?


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with multiple charts ~lexy~ Charts and Charting 1 November 3rd, 2004 04:22 PM
?Column charts + multiple ind. vars + sec. axis? wdeleo Charts and Charting 2 August 19th, 2004 05:18 PM
Multiple Charts at the same time with different data [email protected] Charts and Charting 1 March 29th, 2004 08:36 PM
Multiple Series Pie Charts Chad BATES Charts and Charting 1 September 30th, 2003 05:34 PM
Multiple Charts from single instance of data dvt Charts and Charting 1 September 21st, 2003 01:45 PM


All times are GMT +1. The time now is 07:41 PM.


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