Home |
Search |
Today's Posts |
#13
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excellent Jim!! Thank you so much it is working beautifully.
-- Jamie "Jim Cone" wrote: Jamie, Ok, some sheets have one page and others have 2 or more. This code mod always leaves page 1 with an empty header. If there is only one page to print, that is all you get. Also, check out the supplemental sub at the bottom. Regards, Jim Cone San Francisco, USA "----------------------------------- Sub PrintTest() On Error GoTo PrintError Application.EnableEvents = False Dim TotPages As Long TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)") If TotPages 1 Then With ActiveSheet.PageSetup .LeftHeader = "" ActiveSheet.PrintOut From:=1, To:=1 .LeftHeader = "Unit Intake Report (continued)" ActiveSheet.PrintOut From:=2, To:=TotPages End With Else ActiveSheet.PageSetup.LeftHeader = "" ActiveSheet.PrintOut End If PrintError: Application.EnableEvents = True End Sub '----------------------- 'If, for some reason, the code gets interrupted 'and doesn't run to the end, then run this... Sub ReturnToNormal() Application.EnableEvents = True End Sub "Jamie" wrote in message ... Oh Jim I spoke to soon. My workbook contains 12 sheets, one for each month. For the January sheet I added info so I could get a second page to print, however, for February's sheet I left it as is ( 1 sheet long), but the coding forces a second page to print. The first page does not have a header, second page does. I'm thinking I need to have the coding check to see if there is a page break within the sheet, if so activate the LeftHeader coding, if not ignore the LeftHeader coding. Does that make sense? -- Jamie |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Suppress First Page Numbering | Excel Worksheet Functions | |||
How do I suppress the Header/Footer? | Excel Discussion (Misc queries) | |||
How do you suppress the page number on page one? | Excel Discussion (Misc queries) | |||
How do I suppress a header of footer on the first page of a docume | Setting up and Configuration of Excel | |||
Suppress First Page Header | Excel Worksheet Functions |