Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Header/Footer to update on all sheets | Excel Discussion (Misc queries) | |||
Same Header/Footer-Different Sheets | Excel Discussion (Misc queries) | |||
add a header and or footer to all sheets/tabs | Excel Discussion (Misc queries) | |||
footer for chart sheets | Excel Discussion (Misc queries) | |||
How to set footer and header for all sheets? | Excel Programming |