View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Add Footer to All Sheets

Yeah - didn't look closely at that line - should be

For Each WSheet in Worksheets

or, more qualified:

For Each WSheet In ActiveWorkbook.Worksheets

In article ,
Mike H. wrote:

That modification doesn't compile for me. I get a Variable not defined error
on the For statement?????

"JE McGimpsey" wrote:

One way:

Change

With ActiveSheet.PageSetup

to

With WSheet.PageSetup


In article ,
Mike H. wrote:

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