View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jamie Martin Jamie Martin is offline
external usenet poster
 
Posts: 1
Default adding uniform footers

Hi,

I am a VBA newbie and am not too good at tracing my way through the
object model tree. I want to give all the worksheets in 500 Excel files
a standard footer (but a different one if the sheet is a chart instead
of a data table). Here's what I have:

Sub StandardizeFooters()
Book As Workbook
Sheet As Worksheet
For Each Book In Workbooks
For Each Sheet In Book
With ActiveSheet.PageSetup
.LeftFooter = "&F"
.CenterFooter = "printed &D"
.RightFooter = "&P of &N"
End With
Next Sheet
Book.Close
Next Book
End Sub

Can anyone give me the correct syntax for a worksheet, as well as a way
to distinguish between sheets that are charts and those that aren't?
Thanks very much.

Jamie