#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default 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"

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default 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"


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to open a web page through macro? Eric Excel Discussion (Misc queries) 1 August 25th 08 01:46 AM
Macro to launch web page hutchie Excel Discussion (Misc queries) 2 May 17th 06 05:30 PM
Macro that copy page to page just some filled cells LC Excel Discussion (Misc queries) 0 May 13th 05 11:22 PM
Using macro for page break Sara Excel Discussion (Misc queries) 2 January 13th 05 09:29 PM
Page break macro lehigh46 Excel Worksheet Functions 2 November 17th 04 02:00 AM


All times are GMT +1. The time now is 10:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"