Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default PAGE.SETUP header format query


Hi

I'm trying to insert a carriage return into the page header using the
PAGE.SETUP Excel 4 Macro. I'd be grateful for any pointers.

I was originally using the .pagesetup function but it was taking too
long to communicate with our network printers so I switched to using
John Green's PAGE.SETUP code which is quicker and works fine except for
the issue with the carriage return.

This is the original line of code I'm trying to replicate with the
page.setup macro:
wTargetwks.PageSetup.CenterHeader = "&F" & vbCr & "&A"

The page.setup equivalent I'm using is:
head = """&C&F" & vbCr & "&C&A"""

When I use the .pagesetup version excel correctly recognises the
carriage return and puts the tab name underneath the workbook name.
When I use the page.setup version excel doesn't recognise the carriage
return and both names are superimposed on top of each other on the same
line.

If you then go into Page Setup in Excel and view the custom header
Excel then 'recognises' the carriage return and if you click on okay
the header is correctly displayed.

Does anyone know of a way around this problem? The only work around I
can think of is to put the worksheet name and tab name in different
parts of the header, however I need to maintain the existing worksheet
format if I can.

Any help would be most appreciated.

Thanks

Paul


--
pyarram
------------------------------------------------------------------------
pyarram's Profile: http://www.excelforum.com/member.php...o&userid=32404
View this thread: http://www.excelforum.com/showthread...hreadid=521690

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default PAGE.SETUP header format query

This works for me:

Application.ExecuteExcel4Macro "PAGE.SETUP(""&C&F" & vbCr & "&A"")"


--
Jim
"pyarram" wrote in
message ...
|
| Hi
|
| I'm trying to insert a carriage return into the page header using the
| PAGE.SETUP Excel 4 Macro. I'd be grateful for any pointers.
|
| I was originally using the .pagesetup function but it was taking too
| long to communicate with our network printers so I switched to using
| John Green's PAGE.SETUP code which is quicker and works fine except for
| the issue with the carriage return.
|
| This is the original line of code I'm trying to replicate with the
| page.setup macro:
| wTargetwks.PageSetup.CenterHeader = "&F" & vbCr & "&A"
|
| The page.setup equivalent I'm using is:
| head = """&C&F" & vbCr & "&C&A"""
|
| When I use the .pagesetup version excel correctly recognises the
| carriage return and puts the tab name underneath the workbook name.
| When I use the page.setup version excel doesn't recognise the carriage
| return and both names are superimposed on top of each other on the same
| line.
|
| If you then go into Page Setup in Excel and view the custom header
| Excel then 'recognises' the carriage return and if you click on okay
| the header is correctly displayed.
|
| Does anyone know of a way around this problem? The only work around I
| can think of is to put the worksheet name and tab name in different
| parts of the header, however I need to maintain the existing worksheet
| format if I can.
|
| Any help would be most appreciated.
|
| Thanks
|
| Paul
|
|
| --
| pyarram
| ------------------------------------------------------------------------
| pyarram's Profile:
http://www.excelforum.com/member.php...o&userid=32404
| View this thread: http://www.excelforum.com/showthread...hreadid=521690
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default PAGE.SETUP header format query


Jim

Thanks that worked.

The extra &C I'd added before the &A must have been confusing it?

Application.ExecuteExcel4Macro "PAGE.SETUP(""&C&F" & vbCr & "&*C*A"")"

Thanks

Paul


--
pyarram
------------------------------------------------------------------------
pyarram's Profile: http://www.excelforum.com/member.php...o&userid=32404
View this thread: http://www.excelforum.com/showthread...hreadid=521690

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
page setup, header/footer just peachy Excel Discussion (Misc queries) 0 April 2nd 09 05:05 PM
How do I set a date formula in the page setup header to add 10 phil@work Excel Discussion (Misc queries) 3 June 15th 06 03:47 PM
page setup query hsg Excel Discussion (Misc queries) 0 March 17th 06 07:28 PM
How do I setup a header in Excel that prints only on first page? mikesam7 Excel Discussion (Misc queries) 3 August 24th 05 08:16 PM
how do you delete a header in Page Setup? sdf Excel Discussion (Misc queries) 2 April 19th 05 09:45 PM


All times are GMT +1. The time now is 09:46 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"