Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 152
Default Hidden characters

Two formulas appear the same:
ActiveSheet.PageSetup.RightHeader = _
"&""Arial Narrow,Regular""&8Page &P of " & N

The one recorded with the Macro Recorder has the "N" encased in [] (didn't
work).
What are these "[]", how, where, and when should are they used?
Thanks
Lou
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Hidden characters

I think you may be confusing the special codes that Excel uses for inserting
data (page no., total pages, date, etc.) into headers/footer with the codes
Excel VBA uses.

If you look in the page setup for an Excel worksheet, the page number code
shows as "[&Page]". However, the special code that you must use in Excel VBA
is "&P" (note no space between & and P). If I understand what you're trying
to do, you want to put "Page x of y" in your right header. In Excel VBA, you
would write the string "Page &P of &N". The "&" tells Excel the next
character is a special code.

For more information, search for "Formatting Codes for Headers and Footers"
in the VBA help files.

"Rookie 1st class" wrote:

Two formulas appear the same:
ActiveSheet.PageSetup.RightHeader = _
"&""Arial Narrow,Regular""&8Page &P of " & N

The one recorded with the Macro Recorder has the "N" encased in [] (didn't
work).
What are these "[]", how, where, and when should are they used?
Thanks
Lou

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
View hidden characters fitou_learn Excel Discussion (Misc queries) 6 April 22nd 23 10:11 AM
Hidden Characters? GL Excel Discussion (Misc queries) 2 September 14th 08 02:07 PM
Trim hidden characters? robotman Excel Worksheet Functions 3 October 20th 07 12:00 AM
Help! Can't get rid of hidden characters tragopanic Excel Discussion (Misc queries) 1 July 13th 05 10:20 PM
Hidden characters Diana[_3_] Excel Programming 1 July 31st 03 05:26 AM


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

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

About Us

"It's about Microsoft Excel"