Total Number of Pages per Worksheet

mcquilr

New Member
Joined
May 13, 2010
Messages
6
Hi

I am trying to print an entire workbook to pdf at the same time. I have numberous worksheets in the workbook and each needs to be a seperate document which in the footer states page x of y.
I have managed to get all worksheets to print out starting at page 1 and running through my problem is the total number of sheets (y) is coming out as the total number of pages per workbook instead of per worksheet. Can I use VBA code to get around this?

Thanks
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Welcome to the Board.

To do that you will need to print one worksheet at a time rather than group the sheets and print all at once.
 
Upvote 0
Thanks for the Weclome Andrew.

Is there no way of doing this in code? I know I can do it worksheet by worksheet but this is very tedious for something that will be used quite a lot.

The other alternative I was considering was using this code to automatically print each worksheet to pdf

Sub Print_particular_selected_sheets()
Dim Sheet_n As Worksheet
For Each Sheet_n In ActiveWindow.SelectedSheets
Sheet_n.PrintOut
Next
End Sub

My problem with this code is that it still requires the operator to type in a name against each tab and I cannot seem to get it to work where it automatically prints each one to pdf, saving as the tab name.

Any ideas?

Thanks
Rachel
 
Upvote 0
It works fine if I do that but the macro only records the print function, it doesn't record the saving of the pdf file
 
Upvote 0
Sub XX()
'
' XX Macro

Sheets("V2532-00").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub
 
Upvote 0
I then get this code:

Sub Macro5()
'
Sheets("V2532-00").Select
Application.ActivePrinter = "Adobe PDF on Ne02:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub

but is there a way that I can get it to save automatically with the name of the tab?
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,716
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top