start page numbering after table of contents

G

Guest

I need to start page numbering after my table of contents on a single
worksheet. i.e. my worksheet is 40 pages but page 1 is the cover sheet &
page 2 is the TOC. I want to start my page numbering on what I consider page
3. The page numbers should be consecutive starting on page 3.
 
R

Ron de Bruin

Hi J. Williams

You can do it with code like this

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.LeftFooter = ""
ActiveSheet.PrintOut From:=1, To:=2
.LeftFooter = "&P-2 "
ActiveSheet.PrintOut From:=3, To:=TotPages
End With
End Sub
 

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