ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Page macro (https://www.excelbanter.com/excel-discussion-misc-queries/224765-page-macro.html)

user

Page macro
 
When my macro runs, I want the page number to show "1 of 5" on 1st page and
"2 of 5" on 2nd page. This is what I have so far, but its printing 2of2, not
2of5. Also, how do I correctly put "of" in.
.CenterFooter = "&P&[of]&P"
--
Thanks in advance

Chip Pearson

Page macro
 

Use

&[Page] Of &[Pages]

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Wed, 18 Mar 2009 12:41:19 -0700, user
wrote:

When my macro runs, I want the page number to show "1 of 5" on 1st page and
"2 of 5" on 2nd page. This is what I have so far, but its printing 2of2, not
2of5. Also, how do I correctly put "of" in.
.CenterFooter = "&P&[of]&P"


Gord Dibben

Page macro
 
..CenterFooter = "Page &P of &N"

Are you sure you have 5 pages in the printrange?


Gord Dibben MS Excel MVP

On Wed, 18 Mar 2009 12:41:19 -0700, user
wrote:

When my macro runs, I want the page number to show "1 of 5" on 1st page and
"2 of 5" on 2nd page. This is what I have so far, but its printing 2of2, not
2of5. Also, how do I correctly put "of" in.
.CenterFooter = "&P&[of]&P"




All times are GMT +1. The time now is 11:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com