MrExcel Publishing
Your One Stop for Excel Tips & Solutions

help:how do i make the footer give me the page number in roman numerals


Posted by Jaime on March 05, 2000 7:22 PM

Hi, i have an excel sheet that has 30 o so pages.
I want to number the pages, but i want it in roman numerals.
I can number the sheets with
activesheet.pagesetup.centerfooter=activesheet.index

So i was wondering if there is someting like activeshet.pagenumeber
or something?

Please help. Come on Celia this is easy for u ;^)>


Posted by Chris on March 06, 2000 5:47 AM

Jaime,

You modify your existing line of code to the following:

ActiveSheet.PageSetup.CenterFooter = Application.WorksheetFunction.Roman(ActiveSheet.Index)

HTH,
Chris

Posted by Jaime on March 06, 2000 10:03 AM


I know, but with this code all the pages in one sheet will have the same number, that would be the index of the sheet i am in.
Remember I am trying to number the pages not the sheets.
Thanks

Posted by Chris on March 06, 2000 1:09 PM

Jaime,

Based on your original attempt, I assumed that there was only one printed page per sheet. Here is a solution that will print all pages in the workbook and increasing the page number by one each time. Uses an XLM macro to determine the number of pages on the sheet to print.

Sub PrintWithRoman()
PageCount = 0
For Each sht In Worksheets
sht.Activate
Pages = ExecuteExcel4Macro("Get.Document(50)")
For n = 1 To Pages
PageCount = PageCount + 1
ActiveSheet.PageSetup.CenterFooter = Application.WorksheetFunction.Roman(PageCount)
ActiveWindow.SelectedSheets.PrintOut From:=n, to:=n
Next n
Next sht
End Sub

HTH,
Chris

Posted by Jaime on March 06, 2000 3:35 PM


Thanks a million this really helps