Page numbers on odd pages only

R

Rene

I have a spreadsheet where I only need to print the odd numbered pages (the
even pages are hidden back-up info), but I need them to be numbered 1, 2, 3,
etc instead of 1, 3, 5. Any suggestions?

Thanks!
 
E

Earl Kiosterud

Rene,

Probably a macro will be required. It will do each page as a separate print
job.

TotalPages = 10
For PageNumber = 1 To TotalPages Step 2
' (PageNumber will be 1 3 5, etc.)

' Set first page to PageNumber (first page is only page)
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 300
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = PageNumber ' This one we need
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
End With

' The following line prints page PageNumber:
ActiveWindow.SelectedSheets.PrintOut From:=PageNumber, To:=PageNumber,
Copies:=1, Collate _
:=True

You can remove all the junk in the With ActiveSheet.PageSetup clause if you
want to (like .LeftHeader = "", etc), except .FirstPageNumber = PageNumber.
Otherwise it will overwrite any page setup settings you've put in.

You can paste this from here directly into a module in the VBE. Fix any
broken lines that the email (a junky old teletypewrite) broke up. :)

This is untested. It will eventually fail when it tries to print a page
beyond TotalPages (maybe sooner!). We can probably fix that. See if it
works for you.

Earl Kiosterud
mvpearl omitthisword at verizon period net
so far no spam
 
J

J.E. McGimpsey

If your "hidden back-up info" pages are actually hidden, the "odd"
pages will print out with sequential numbering.

Consider using Data/Group and Outline to group your "even" pages to
make hiding them easy. You could also record a macro to automate the
printing.
 
E

Earl Kiosterud

Rene,

Hmmm. J.E.'s answer has me wondering. If by hidden pages, you mean hidden
sheets (as you probably do), my solution isn't for you.
 

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

Top