Hy Guys,
I have a 'with without for' error.
I want to make the cell 'rightfooter' on sheet1 the value of the right footer on everysheet. But my cycle through macro is producing a with without for error:
Please help, thanks
I have a 'with without for' error.
I want to make the cell 'rightfooter' on sheet1 the value of the right footer on everysheet. But my cycle through macro is producing a with without for error:

Code:
Sub rightfooter()
Application.ScreenUpdating = False
Sheets("sheet2").Visible = True
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
r = Worksheets("Sheet1").Range("rightfooter")
With ActiveSheet.PageSetup
.RightFooter = r
Next ws
Sheets("sheet1").Select
Application.ScreenUpdating = True
End Sub
Please help, thanks