I have a document that needs to have the sequential page numbering in the header BUT I also need to sequentially number individual, multiple page maintenance procedures in the footer. In the footer, the number after the XXX- designation the is sequential page number of that procedure; and I have about 300 individually named/numbered procedures. Anyone have any thoughts, I have been racking my brain for days with no solution.

Header: pg. 1

Footer: Procedure AAA-1

Header: pg. 2

Footer: Procedure AAA-2

Header: pg. 3

Footer: Procedure AAA-3

Header: pg. 4

Footer: Procedure BBB-1

Header: pg. 5

Footer: Procedure BBB-2

Header: pg. 6

Footer: Procedure BBB-3

Header: pg. 7

Footer: Procedure CCC-1


So, with a little help from Allen Wyatt's WordTips, I was able to write some VBA code that allowed me to accomplish/automate this task. Unbelievable how hard Word makes this seemingly simple process.

  1. There needs to be a "next page" section break after every procedure and every procedure needs to start at page "1"
  2. There needs to be a bookmark (I choose a scheme that I could incrementally number and use in an automated process) before every section break
  3. Allen Wyatt's WordTips shows you how to do it manually. If you're interested in an automated solution, please contact me for the VBA code. Below is an abbreviated manual solution from WordTips:

a. In the header of section 1 put the following field (the curly brackets indicate fields, which are added by pressing Ctrl+F9):


b. In the header of section 2 place the following compound field, which gives the number of pages in the previous section plus the page number of the current section:

 {= {pageref A} + {page}}

You enter (do not type the quotes shown around the text to enter)

1. Ctrl F9
2. type "="
3. Ctrl F9
4. type "pageref A" (or substitute whatever you have chosen for your bookmark naming scheme for "A")
5. Place your cursor past the closing curly brace for "pageref A"
6. type "+"
7. Ctrl F9
8. type page
9. select the entire formula; press F9 to update

c. In the header of section 3, place the following compound field (use the same process shown in Step B):

 {= {pageref A} + {pageref B} + {page}}

d.In the header of each subsequent section, follow the same pattern shown in step C. You want each formula to result in the total count of pages in all sections prior to the section in which the footer is located, along with the page number within that particular section

As you can see, doing this for 300 procedures would get very time consuming. The VBA automation code really helps speed this process up.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.