Many worksheets in workbook

  • Thread starter Thread starter Diana
  • Start date Start date
D

Diana

I have a workbook with many worksheets (Excel 2002) and I
want to put the "filename and path" into the footer of
each. Is there a way to so this to all worksheets at
once, or do I have to them one at a time.

Thanks.
 
Hi Diana,
Click on Sheet1's tab; hold SHIFT key; click on tab of last sheet. You have
'grouped' the sheets; what you do to one is done to all.
Open File|PageSetup; go to Custom footer; use the File icon (the Excel X) to
put file code into one of the tree footer section.
Close the dialogs with OK buttons.
REMEMBER to ungroup right away by clicking an individual sheet's tab.

Best wishes
Bernard
 
Hi....while Bernard's suggestion works beautifully. There are some
instances where it may not work as planned. I have a workbook with
"many" sheets in it. All the headers and footers are set, but all I
need to change is 1 thing in a header or footer, and if you select all
the sheets, then all the sheets headers and footers will change to
match the first sheets headers and footers. I found that out the hard
way. What I did is write a little macro that will select each sheet one
at a time, and change the footers to cell values I've placed on a setup
sheet. Or you could modify this by inputting the values directly into
the code:


Code:
--------------------

Sub setFooter()

Dim mySht As Variant
Dim i As Integer

For Each mySht In Worksheets
mySht.Activate
ActiveSheet.PageSetup.LeftFooter = _
"&10" & Format(Worksheets("xSetUp").Range("E5").Value)
ActiveSheet.PageSetup.CenterFooter = _
"&10" & Format(Worksheets("xSetUp").Range("F5").Value)
ActiveSheet.PageSetup.RightFooter = _
"&10" & Format(Worksheets("xSetUp").Range("G5").Value & Chr(13) & "Printed" & " " & "&D &T")
Next

End Sub
--------------------



I hope this points you in the right direction...and helps a bit...

Have a good day,

Dave M.
 
That's great Bernard, thanks so much.
-----Original Message-----
Hi Diana,
Click on Sheet1's tab; hold SHIFT key; click on tab of last sheet. You have
'grouped' the sheets; what you do to one is done to all.
Open File|PageSetup; go to Custom footer; use the File icon (the Excel X) to
put file code into one of the tree footer section.
Close the dialogs with OK buttons.
REMEMBER to ungroup right away by clicking an individual sheet's tab.

Best wishes
Bernard




.
 
Back
Top