ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Setting up and Configuration of Excel (https://www.excelbanter.com/setting-up-configuration-excel/)
-   -   Header question (https://www.excelbanter.com/setting-up-configuration-excel/38021-header-question.html)

Peter

Header question
 
Hi,

Can anyone please advise if it is possible to have the header in an
Excel 2003 workbook only apply to the first worksheet and not to the
subsequent worksheets in that workbook?

If so, how to achieve it?


--
Cheers

Peter

Please remove the invalid to reply

Paul B

Peter, here is one way by Ron de Bruin

Sub print_header()

'will print header on 1st page only

'By: Ron de Bruin

Totpage = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")

With ActiveSheet.PageSetup

.LeftHeader = "test"

.CenterFooter = ActiveSheet.Range("A1")

.CenterHeader = "&8Page &8&P & of &N"

ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1

.LeftHeader = ""

.CenterHeader = ""

ActiveWindow.SelectedSheets.PrintOut From:=2, To:=Totpage

End With

End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003


"Peter" wrote in message
...
Hi,

Can anyone please advise if it is possible to have the header in an
Excel 2003 workbook only apply to the first worksheet and not to the
subsequent worksheets in that workbook?

If so, how to achieve it?


--
Cheers

Peter

Please remove the invalid to reply




Peter

On Mon, 1 Aug 2005 11:29:20 -0400, "Paul B"
wrote:

Peter, here is one way by Ron de Bruin

Sub print_header()

'will print header on 1st page only

'By: Ron de Bruin

Totpage = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")

With ActiveSheet.PageSetup

.LeftHeader = "test"

.CenterFooter = ActiveSheet.Range("A1")

.CenterHeader = "&8Page &8&P & of &N"

ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1

.LeftHeader = ""

.CenterHeader = ""

ActiveWindow.SelectedSheets.PrintOut From:=2, To:=Totpage

End With

End Sub



Many thanks Paul
--
Cheers

Peter

Please remove the invalid to reply


All times are GMT +1. The time now is 09:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com