Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default Add Footer to All Sheets

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Add Footer to All Sheets

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Add Footer to All Sheets

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default Add Footer to All Sheets

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   Report Post  
Posted to microsoft.public.excel.programming
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Header/Footer to update on all sheets Jonno Excel Discussion (Misc queries) 5 August 13th 09 01:15 PM
Same Header/Footer-Different Sheets Skydiver Excel Discussion (Misc queries) 5 October 28th 06 12:31 AM
add a header and or footer to all sheets/tabs Sharon Excel Discussion (Misc queries) 1 September 14th 05 07:46 PM
footer for chart sheets maryj Excel Discussion (Misc queries) 4 June 20th 05 06:41 PM
How to set footer and header for all sheets? Kurt Remlin Excel Programming 2 May 1st 04 07:10 AM


All times are GMT +1. The time now is 10:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"