How can I add non-standard page numbers to a Word Document using an Excel list?

Jerald Miller 5 Reputation points
2025-11-24T15:00:44.6566667+00:00

I am trying to add Mayan numerals as page numbers in a Word document. I have my list of the numerals 1 - 1200 in a separate Excel document. Column A has the standard Arabic numerals, column B has the Mayan numerals, and column C has the number written out in Q'eqchi' (a Mayan language). I can add the standard Arabic page numbers to the header of my Word document (approximately 600 pages), but then I need to somehow have Word match that page number to the Excel list, and pull in the corresponding numeral and written out number into the Word footer. The numeral needs to be in a text box, but the number written out in word form could be in a text box also, or could be just in the footer.

It seems that there must be some way to do this with fields, mail merge, or at least with VBA. How can I make custom page numbers like this by pulling the information from my list in Excel?

Here is a link where you can download the sample files Mayan page number samples. Please note that you will need the "Noto Sans Mayan Numerals" font to properly display the numerals. The header and footer is approximately like I will want it, although there will probably be further adjustments to the formatting. But the footer just has the numbers 507 and 508 on all the pages as an example of how it should look. I need it to somehow pull in the correct information for each page from my Excel document.

Microsoft 365 and Office | Word | For home | Windows
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-11-24T15:01:03.3933333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To add non-standard page numbers, such as Mayan numerals, to a Word document using an Excel list, you can use a combination of VBA (Visual Basic for Applications) and Word fields. Here’s a general approach you can follow:

    1. Prepare Your Excel Data: Ensure your Excel document is structured correctly with Arabic numerals in Column A, Mayan numerals in Column B, and the written form in Q'eqchi' in Column C.
    2. Open Word and Access the VBA Editor: In Word, press ALT + F11 to open the VBA editor.
    3. Create a New Module: In the VBA editor, right-click on any of the items in the Project Explorer, go to Insert, and then click Module.
    4. Write the VBA Code: You can write a VBA macro that will loop through the pages of your Word document and pull the corresponding Mayan numeral and written form from your Excel file. Here’s a sample code snippet:
         Sub InsertMayanPageNumbers()
             Dim xlApp As Object
             Dim xlWorkbook As Object
             Dim xlSheet As Object
             Dim i As Integer
             Dim pageNum As Integer
             Dim mayanNum As String
             Dim writtenNum As String
         
             ' Open Excel and the specific workbook
             Set xlApp = CreateObject("Excel.Application")
             Set xlWorkbook = xlApp.Workbooks.Open("C:\path\to\your\excel.xlsx")
             Set xlSheet = xlWorkbook.Sheets(1)
         
             ' Loop through each page in the Word document
             For i = 1 To ActiveDocument.ComputeStatistics(wdStatisticPages)
                 pageNum = i
                 mayanNum = xlSheet.Cells(pageNum, 2).Value ' Mayan numeral in Column B
                 writtenNum = xlSheet.Cells(pageNum, 3).Value ' Written form in Column C
         
                 ' Insert Mayan numeral in a text box in the footer
                 With ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary)
                     .Range.Text = "Page " & pageNum & " - " & mayanNum
                     ' Optionally, you can add the written form here as well
                     .Range.InsertAfter " - " & writtenNum
                 End With
             Next i
         
             ' Clean up
             xlWorkbook.Close False
             xlApp.Quit
             Set xlSheet = Nothing
             Set xlWorkbook = Nothing
             Set xlApp = Nothing
         End Sub
      
    5. Run the Macro: Close the VBA editor and run the macro from the Word interface (you may need to enable macros in Word).
    6. Font Consideration: Make sure to set the font of the text box to "Noto Sans Mayan Numerals" to properly display the Mayan numerals.

    This approach will automate the process of inserting the custom page numbers into your Word document based on the data from your Excel file. Adjust the paths and ensure your Excel file is accessible from the Word macro.

    0 comments No comments

  2. Noel Macadangdang 8,080 Reputation points Independent Advisor
    2025-11-24T15:41:42.7433333+00:00

    Hi Jerald,

    Thank you for sharing your question. I completely understand the need to show Mayan numerals and Q’eqchi’ number names rather than standard Arabic page numbers. Word page numbers are generated by the PAGE field, but headers and footers repeat per section, not per page, which is why your footer can’t change automatically on every page unless each page is its own section and the “Link to Previous” setting is turned off. I am here to help.

    The reason this matter is that Word lets you have different headers and footers only when pages are separated by section breaks, and by default new sections inherit the previous section’s header/footer; you have to unlink them to make each page’s footer unique. Once every page is its own section, you can pull the matching Mayan numeral and Q’eqchi’ text from Excel and place them into a text box and the footer for that page.

    The most reliable resolution for an existing 600‑page document is a VBA macro that does three things in sequence: it inserts a Next Page section break at the start of each page, it unlinks the footer in each new section from the previous one, and it reads your Excel list to insert the correct Mayan numeral (in a text box) and the Q’eqchi’ number name (as footer text). This approach uses Word’s documented methods for inserting breaks and sections and for placing shapes inside headers/footers.

    I hope this answer is helpful, if you have any questions, feel free to reply.

    Best Regards,

    Noel

     


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.