Print workbook

G

Gordon

Hi...

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

Gordon.
 
L

Leith Ross

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
 
D

David

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)")
 
Top