ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Suppress First Page Header (https://www.excelbanter.com/excel-worksheet-functions/25762-suppress-first-page-header.html)

Jamie

Suppress First Page Header
 
I'm working in Excel 2002.

How can I suppress a header on the first page, but have it print on the
pages that follow.

The text that I want printed in the header beginning on page 2 is Unit
Intake Report (continued)

Thanks
--
Jamie

Ron de Bruin

Hi Jamie

If you print with a macro it is possible
See http://www.rondebruin.nl/print.htm#Header

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Jamie" wrote in message ...
I'm working in Excel 2002.

How can I suppress a header on the first page, but have it print on the
pages that follow.

The text that I want printed in the header beginning on page 2 is Unit
Intake Report (continued)

Thanks
--
Jamie




Jamie

Hi Ron, I have tried this macro, but my header does not appear on the second
page. I changed the coding to this:

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.LeftHeader = ""
ActiveSheet.PrintOut From:=1, To:=1
.LeftHeader = "Unit Intake Report (continued)"
ActiveSheet.PrintOut From:=2, To:=TotPages
End With
End Sub

Do I need to include:

.CenterFooter = "&8Page &P & of &N"
.RightFooter = "&8Last Saved : &B" &
ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")
.LeftFooter = "&8" & ActiveWorkbook.FullName & Chr(10) & "Sheetname
: &B" & ActiveSheet.Name

Thanks
--
Jamie


"Ron de Bruin" wrote:

Hi Jamie

If you print with a macro it is possible
See http://www.rondebruin.nl/print.htm#Header

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Jamie" wrote in message ...
I'm working in Excel 2002.

How can I suppress a header on the first page, but have it print on the
pages that follow.

The text that I want printed in the header beginning on page 2 is Unit
Intake Report (continued)

Thanks
--
Jamie





Ron de Bruin

Hi Jamie

I have no problem when I run it ?
Test it on a new workbook

Do I need to include:

No, just examples


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Jamie" wrote in message ...
Hi Ron, I have tried this macro, but my header does not appear on the second
page. I changed the coding to this:

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.LeftHeader = ""
ActiveSheet.PrintOut From:=1, To:=1
.LeftHeader = "Unit Intake Report (continued)"
ActiveSheet.PrintOut From:=2, To:=TotPages
End With
End Sub

Do I need to include:

.CenterFooter = "&8Page &P & of &N"
.RightFooter = "&8Last Saved : &B" &
ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")
.LeftFooter = "&8" & ActiveWorkbook.FullName & Chr(10) & "Sheetname
: &B" & ActiveSheet.Name

Thanks
--
Jamie


"Ron de Bruin" wrote:

Hi Jamie

If you print with a macro it is possible
See http://www.rondebruin.nl/print.htm#Header

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Jamie" wrote in message ...
I'm working in Excel 2002.

How can I suppress a header on the first page, but have it print on the
pages that follow.

The text that I want printed in the header beginning on page 2 is Unit
Intake Report (continued)

Thanks
--
Jamie







Jamie

Hi Ron, I'm sorry I forgot to mention that the document is protected, would
that prevent the macro from working.
--
Jamie


"Ron de Bruin" wrote:

Hi Jamie

I have no problem when I run it ?
Test it on a new workbook

Do I need to include:

No, just examples


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Jamie" wrote in message ...
Hi Ron, I have tried this macro, but my header does not appear on the second
page. I changed the coding to this:

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.LeftHeader = ""
ActiveSheet.PrintOut From:=1, To:=1
.LeftHeader = "Unit Intake Report (continued)"
ActiveSheet.PrintOut From:=2, To:=TotPages
End With
End Sub

Do I need to include:

.CenterFooter = "&8Page &P & of &N"
.RightFooter = "&8Last Saved : &B" &
ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")
.LeftFooter = "&8" & ActiveWorkbook.FullName & Chr(10) & "Sheetname
: &B" & ActiveSheet.Name

Thanks
--
Jamie


"Ron de Bruin" wrote:

Hi Jamie

If you print with a macro it is possible
See http://www.rondebruin.nl/print.htm#Header

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Jamie" wrote in message ...
I'm working in Excel 2002.

How can I suppress a header on the first page, but have it print on the
pages that follow.

The text that I want printed in the header beginning on page 2 is Unit
Intake Report (continued)

Thanks
--
Jamie







Ron de Bruin

Hi Jamie

I read in your other thread that you got it working
Sorry I don't tell you that this macro also print ( you not use the print button of excel)

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Jamie" wrote in message ...
Hi Ron, I'm sorry I forgot to mention that the document is protected, would
that prevent the macro from working.
--
Jamie


"Ron de Bruin" wrote:

Hi Jamie

I have no problem when I run it ?
Test it on a new workbook

Do I need to include:

No, just examples


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Jamie" wrote in message ...
Hi Ron, I have tried this macro, but my header does not appear on the second
page. I changed the coding to this:

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.LeftHeader = ""
ActiveSheet.PrintOut From:=1, To:=1
.LeftHeader = "Unit Intake Report (continued)"
ActiveSheet.PrintOut From:=2, To:=TotPages
End With
End Sub

Do I need to include:

.CenterFooter = "&8Page &P & of &N"
.RightFooter = "&8Last Saved : &B" &
ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")
.LeftFooter = "&8" & ActiveWorkbook.FullName & Chr(10) & "Sheetname
: &B" & ActiveSheet.Name

Thanks
--
Jamie


"Ron de Bruin" wrote:

Hi Jamie

If you print with a macro it is possible
See http://www.rondebruin.nl/print.htm#Header

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Jamie" wrote in message ...
I'm working in Excel 2002.

How can I suppress a header on the first page, but have it print on the
pages that follow.

The text that I want printed in the header beginning on page 2 is Unit
Intake Report (continued)

Thanks
--
Jamie









Jamie

Hi Ron, thanks for your solution. I have another question. Can I add coding
to the macro so the user can either use the print button or File, Print. I'd
like to avoid creating a print button on the worksheet.
--
Jamie


"Ron de Bruin" wrote:

Hi Jamie

I read in your other thread that you got it working
Sorry I don't tell you that this macro also print ( you not use the print button of excel)

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Jamie" wrote in message ...
Hi Ron, I'm sorry I forgot to mention that the document is protected, would
that prevent the macro from working.
--
Jamie


"Ron de Bruin" wrote:

Hi Jamie

I have no problem when I run it ?
Test it on a new workbook

Do I need to include:
No, just examples


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Jamie" wrote in message ...
Hi Ron, I have tried this macro, but my header does not appear on the second
page. I changed the coding to this:

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.LeftHeader = ""
ActiveSheet.PrintOut From:=1, To:=1
.LeftHeader = "Unit Intake Report (continued)"
ActiveSheet.PrintOut From:=2, To:=TotPages
End With
End Sub

Do I need to include:

.CenterFooter = "&8Page &P & of &N"
.RightFooter = "&8Last Saved : &B" &
ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")
.LeftFooter = "&8" & ActiveWorkbook.FullName & Chr(10) & "Sheetname
: &B" & ActiveSheet.Name

Thanks
--
Jamie


"Ron de Bruin" wrote:

Hi Jamie

If you print with a macro it is possible
See http://www.rondebruin.nl/print.htm#Header

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Jamie" wrote in message ...
I'm working in Excel 2002.

How can I suppress a header on the first page, but have it print on the
pages that follow.

The text that I want printed in the header beginning on page 2 is Unit
Intake Report (continued)

Thanks
--
Jamie










Ron de Bruin

Hi Jamie

You can use the beforeprint event to do this in the thisworkbook module
If you press the print button your code will run (I use a sheet named "Sheet1" in the example)

See this page for more info about events
http://www.cpearson.com/excel/events.htm


Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim TotPages As Long
If ActiveSheet.Name = "Sheet1" Then
Cancel = True
Application.EnableEvents = False
Application.ScreenUpdating = False
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.RightHeader = "Your Header info"
ActiveSheet.PrintOut From:=1, To:=1
.RightHeader = ""
ActiveSheet.PrintOut From:=2, To:=TotPages
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl



"Jamie" wrote in message ...
Hi Ron, thanks for your solution. I have another question. Can I add coding
to the macro so the user can either use the print button or File, Print. I'd
like to avoid creating a print button on the worksheet.
--
Jamie


"Ron de Bruin" wrote:

Hi Jamie

I read in your other thread that you got it working
Sorry I don't tell you that this macro also print ( you not use the print button of excel)

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Jamie" wrote in message ...
Hi Ron, I'm sorry I forgot to mention that the document is protected, would
that prevent the macro from working.
--
Jamie


"Ron de Bruin" wrote:

Hi Jamie

I have no problem when I run it ?
Test it on a new workbook

Do I need to include:
No, just examples


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Jamie" wrote in message ...
Hi Ron, I have tried this macro, but my header does not appear on the second
page. I changed the coding to this:

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.LeftHeader = ""
ActiveSheet.PrintOut From:=1, To:=1
.LeftHeader = "Unit Intake Report (continued)"
ActiveSheet.PrintOut From:=2, To:=TotPages
End With
End Sub

Do I need to include:

.CenterFooter = "&8Page &P & of &N"
.RightFooter = "&8Last Saved : &B" &
ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")
.LeftFooter = "&8" & ActiveWorkbook.FullName & Chr(10) & "Sheetname
: &B" & ActiveSheet.Name

Thanks
--
Jamie


"Ron de Bruin" wrote:

Hi Jamie

If you print with a macro it is possible
See http://www.rondebruin.nl/print.htm#Header

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Jamie" wrote in message ...
I'm working in Excel 2002.

How can I suppress a header on the first page, but have it print on the
pages that follow.

The text that I want printed in the header beginning on page 2 is Unit
Intake Report (continued)

Thanks
--
Jamie













All times are GMT +1. The time now is 04:15 AM.

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