I need troubleshooting help.
The intention of the below code is to enter a header and footer on all of the sheets in the workbook.
It is not entering the header or footer.
Thanks
Ron
The intention of the below code is to enter a header and footer on all of the sheets in the workbook.
It is not entering the header or footer.
Thanks
Ron
Code:
Sub HeaderFooter()
Dim ws As Worksheet
'On Error Resume Next
Application.ScreenUpdating = False
For Each ws In ThisWorkbook.Worksheets
With ws.PageSetup
'Header
'.LeftHeader = ""
.CenterHeader = "Entered Header"
'.RightHeader = ""
'Footer
'.LeftFooter = "Path : ""
.CenterFooter = "Entered footer"
'.RightFooter = ""
End With
Next ws
Set ws = Nothing
Application.ScreenUpdating = True
End Sub