Macro to set footer in all the sheets

  • Thread starter Thread starter Fernando Gomez
  • Start date Start date
F

Fernando Gomez

I have this macro that works fine (Set titles and dates on the footer):
Sub UpdateFooter()
ActiveSheet.PageSetup.LeftFooter = ActiveWorkbook.FullName
With ActiveSheet.PageSetup
.RightFooter = "Printed on &D &T"
End With
End Sub

Could somebody help me to get a macro that perform the same task but for all
the sheets at once.

Thanks
 
one way:


Public Sub UpdateFooters()
Dim wsSheet As Worksheet
For Each wsSheet In ActiveWorkbook.Worksheets
With wsSheet.PageSetup
.LeftFooter = .Parent.Parent.FullName
.RightFooter = "Printed on &D &T"
End With
Next wsSheet
End Sub
 
Hi
try
Sub UpdateFooter()
dim wks as worksheet
for each wks in activeworkbook.worksheets
With wks.PageSetup
.LeftFooter = ActiveWorkbook.FullName
.RightFooter = "Printed on &D &T"
End With
next
End Sub
 
Back
Top