Print workbook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi...

Looking for some code to print all worksheets within a workbook and put in
page numbers consecutively. Any help appreciated.

Gordon.
 
Hello Gordon,

I can give you the code to print the worksheets, but pages number in
Excel are a quite another matter as Excel doesn't provide any VBA code
to automate accessing, calculating. or manipulating page numbers.


Sub PrintWorksheets()
Dim Wks As Worksheet
For Each Wks In ThisWorkbook.Worksheets
Wks.PrintOut
Next Wks
End Sub

Sincerely,
Leith Ross
 
Leith Ross wrote
Hello Gordon,

I can give you the code to print the worksheets, but pages number in
Excel are a quite another matter as Excel doesn't provide any VBA code
to automate accessing, calculating. or manipulating page numbers.


Sub PrintWorksheets()
Dim Wks As Worksheet
For Each Wks In ThisWorkbook.Worksheets
Wks.PrintOut
Next Wks
End Sub

Sincerely,
Leith Ross

How about this for page#'s?:
Range("A1") = ExecuteExcel4Macro("Get.Document(50)")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top