Printing the same sheet with different page numbers

murry

New Member
Joined
Dec 27, 2012
Messages
17
I have a worksheet in excel that I need to use to create a 100 page logbook. I'm going print the same 1-page worksheet 100 times and bound it. I have to have each page numbered Page 1 of 100, page 2 of 100. . . I'm sure there is a way to do this with some kind of looping print macro, but I'm not sure how. Can someone please help.

Thanks.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Assuming you are wanting these page numbers in the footer you could use a macro that updates the footer then prints the page once and loops back through until 100 pages are printed.


You will either want to make sure you are on your master logbook worksheet before you set this off, or you will want to hardcode the name of your worksheet into the .Printout line.

Code:
Sub PrintLogBook()
Dim x%
x% = 1
For x% = 1 To 100
    With ActiveSheet.PageSetup
                .CenterFooter = x% & " of 100"
    End With
    ActiveSheet.PrintOut
    
Next x%
End Sub

If you prefer the page numbers on the left chage the footer line to
Code:
.LeftFooter = x% & " of 100"

Or if you want them on the right
Code:
.RightFooter = x% & " of 100"
 
Upvote 0
When running a Macro, Do I need to get permission from IT? I have tried to run a Macro to change the page number and It is not working.
 
Upvote 0

Forum statistics

Threads
1,215,770
Messages
6,126,791
Members
449,336
Latest member
p17tootie

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