Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default How to set footer and header for all sheets?

Hi,

I'm creating a brand new workbook with multiple sheets from VB code.
How do I programmatically assign Sheet Name as a header and 'Page 1 of
?' as a footer to all of them? Please advise.

TIA
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default How to set footer and header for all sheets?

Kurt

Select the first sheet by clicking on the tab; select the rest of the sheets
by shift clicking on the last tab.

Now select View | Header and Footer... | Header/Footer tab | modify the
header and footer as required.

If you add the tab name to the header and page information to the footer it
will be applied to all the selected sheets

Regards

Trevor


"Kurt Remlin" wrote in message
om...
Hi,

I'm creating a brand new workbook with multiple sheets from VB code.
How do I programmatically assign Sheet Name as a header and 'Page 1 of
?' as a footer to all of them? Please advise.

TIA



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default How to set footer and header for all sheets?

Sub tester()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws.PageSetup
.LeftHeader = "&A"
.LeftFooter = "Page &P of &N"
End With
Next ws
End Sub



Kurt Remlin wrote:

Hi,

I'm creating a brand new workbook with multiple sheets from VB code.
How do I programmatically assign Sheet Name as a header and 'Page 1 of
?' as a footer to all of them? Please advise.

TIA


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
how to apply the same header or footer to all sheets in workbook Luenda Burke Excel Worksheet Functions 1 November 1st 06 05:45 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
Using same Header & Footer for Multiple Sheets in Excel Master Yoda Excel Discussion (Misc queries) 3 May 30th 05 11:22 PM


All times are GMT +1. The time now is 11:34 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"