Add Footer to All Sheets

  • Thread starter Thread starter Mike H.
  • Start date Start date
M

Mike H.

How do I add a footer to all sheets. This doesn't work because the
activesheet is not selected, I dont' think.

Sub AddFooters()
Dim WSheet As Worksheet
For Each WSheet In Worksheet
With ActiveSheet.PageSetup
.LeftFooter = "&Z&F"
.RightFooter = "&A"
.Zoom = False
End With
Next WSheet

End Sub
 
untried but should work.

Sub AddFooters()
Dim i As Long
For i = 1 To ActiveWorkbook.sheets.Count
With Sheets(i).PageSetup
.LeftFooter = "&Z&F"
.RightFooter = "&A"
.Zoom = False
End With
Next
End Sub
 
Yeah - didn't look closely at that line - should be

For Each WSheet in Worksheets

or, more qualified:

For Each WSheet In ActiveWorkbook.Worksheets
 
Back
Top