I am looking to set the Footer for all worksheets on opening of workbook.
Using the code above I get the error 'Objective variable or with block variable not set'. Is this the best way or can it be achieved another way.
Thanks
Code:
Private Sub Workbook_Open()
For Each ws In ActiveWorkbook.Worksheets
With ws.PageSetup
.LeftFooter = " 2 LEFT"
.CenterFooter = "2 CENTRE"
.RightFooter = "2 RIGHT"
End With
Next
End Sub
Using the code above I get the error 'Objective variable or with block variable not set'. Is this the best way or can it be achieved another way.
Thanks