LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
F J F J is offline
external usenet poster
 
Posts: 5
Default Print entire workbook with each sheet starting at page 1

On May 23, 12:12*pm, Gord Dibben wrote:
OK for printing worksheet at a time but as soon as you introduce the statement

ActiveWorkbook.PrintOut, you have abandoned the sheet by sheet printing.

I am quite sure that printing an entire workbook to a single *PDF file will not

respect your page numbering.

Gord



On Mon, 23 May 2011 02:30:58 -0700 (PDT), F J wrote:
Hi, Gord, thank you for your response. *Your macro worked great! :)
Just as a follow up question, though, I tried to modify the code a bit
so that if I had to print to PDF instead of to a printer, it wouldn't
print a separate file for each sheet but would still start each sheet
with page 1 and give the correct page total for each sheet. *The
problem I'm running into now is that although I can get it so that
each sheet starts with page 1, the page totals for each sheet are not
correct. *It still gives the total number of pages in the entire
workbook, not the total number of pages for each sheet. *Is there any
way to do this? *Below is the code as I modified it. *Thank you in
advance for any information.


Sub test()
* *Dim ws As Worksheet
* *For Each ws In ActiveWorkbook.Worksheets
* * * *ws.PageSetup.CenterHeader = "Page &P of &N"
* * * *With ActiveSheet.PageSetup
* * * *.FirstPageNumber = 1
* * * *End With
* * Next ws
* *ActiveWorkbook.PrintOut Copies:=1, preview:=False
End Sub- Hide quoted text -


- Show quoted text -


Hi, Gord, yes, it works for one worksheet at a time but not for the
whole workbook. I guess maybe there isn't a way to do it when
printing to PDF.
 
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
How can I apply print area and page setup to entire workbook? Simon Willard Excel Discussion (Misc queries) 1 September 8th 08 01:49 PM
How to print entire workbook 9 pages to a sheet? JDS Excel Worksheet Functions 7 July 14th 08 09:47 PM
Macro to open print window and set to print entire workbook retseort Excel Discussion (Misc queries) 1 October 27th 05 11:00 PM
How do you format a sheet to fill the entire page to print? Lindsay Excel Discussion (Misc queries) 1 June 28th 05 09:17 PM
How can I print page 2 of each sheet in a workbook? sflower Excel Discussion (Misc queries) 1 March 9th 05 02:15 PM


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

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"