Printing Page Numbers

  • Thread starter Thread starter Tony McGee
  • Start date Start date
T

Tony McGee

Hello all

I have a three page Excel spreadsheet which I want to print as starting at
page 23 with the page number appearing in the Right Header as "Page 23",
"Page 24" & "Page 25"

Any hints on how I do this in code without affecting any existing Left &
Centre Headers I have set up via the Page Setup Dialog box? Ideally, a popup
input box which asked what page number I would like to start at would be
just perfect.

Thanks
Tony McGee
 
Hi Tony,
You don't really need a macro to this, but if it is to be a part of
a macro you can record a macro to see what you get and use that.
I didn't try recording a macro.

Using Excel 2000 and above use Page Setup, Page tab,
first page number: change the word Auto to the number for your first page.

Recording a macro and extracting the part you want would be something like:

Sub Macro21()
With ActiveSheet.PageSetup
.RightHeader = "Page &P"
.FirstPageNumber = 23
End With
ActiveWindow.SelectedSheets.PrintPreview
End sub

More information on pathname, headers and footers in
http://www.mvps.org/dmcritchie/excel/pathname.htm
 
Tony said:
I have a three page Excel spreadsheet which I want to print as
starting at page 23 with the page number appearing in the Right Header
as "Page 23", "Page 24" & "Page 25"

Any hints on how I do this in code without affecting any existing Left
& Centre Headers I have set up via the Page Setup Dialog box? ...

Using
File >> Page Setup
Click on the "Page" tab and set the "First page number" to 23 or the number
of your choice.

Then switch to the "Header/Footer" tab and click "Custom header." This lets
you set up the three header sections (left, center, right) individually.

So you don't need code, really (though this might not be as convenient as
you'd like).
 

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