Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 186
Default Retrieve Center Header String

As part of a macro I am opening an existing workbook. That WB has a center
header in the print set up. How can I pull that center header string into the
macro and assign it to a variable?

Dim SHeader as String
Sub GetHeader
Workbooks.Open "Test.xls"
sHeader= what?
...........
........
End Sub
--
Ken Hudson
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Retrieve Center Header String

Assign the PageSetup.CenterHeader property for the worksheet to your
variable.

--
Rick (MVP - Excel)


"Ken Hudson" wrote in message
...
As part of a macro I am opening an existing workbook. That WB has a center
header in the print set up. How can I pull that center header string into
the
macro and assign it to a variable?

Dim SHeader as String
Sub GetHeader
Workbooks.Open "Test.xls"
sHeader= what?
...........
........
End Sub
--
Ken Hudson


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 186
Default Retrieve Center Header String

I can't get the code right to do this.

sHeader=PageSetup.CenterHeader

doesn't work?
--
Ken Hudson


"Rick Rothstein" wrote:

Assign the PageSetup.CenterHeader property for the worksheet to your
variable.

--
Rick (MVP - Excel)


"Ken Hudson" wrote in message
...
As part of a macro I am opening an existing workbook. That WB has a center
header in the print set up. How can I pull that center header string into
the
macro and assign it to a variable?

Dim SHeader as String
Sub GetHeader
Workbooks.Open "Test.xls"
sHeader= what?
...........
........
End Sub
--
Ken Hudson



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 186
Default Retrieve Center Header String

orry Rick, I got it. I needed:

sHeader=ActiveSheet.PageSeetup.CenterHeader

My apologies.
--
Ken Hudson


"Rick Rothstein" wrote:

Assign the PageSetup.CenterHeader property for the worksheet to your
variable.

--
Rick (MVP - Excel)


"Ken Hudson" wrote in message
...
As part of a macro I am opening an existing workbook. That WB has a center
header in the print set up. How can I pull that center header string into
the
macro and assign it to a variable?

Dim SHeader as String
Sub GetHeader
Workbooks.Open "Test.xls"
sHeader= what?
...........
........
End Sub
--
Ken Hudson



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 retrieve the value within string? Eric Excel Discussion (Misc queries) 11 April 20th 10 12:47 PM
How can I Left justify the center section of the print header? abohlin Excel Programming 2 March 29th 07 10:14 PM
How do I left justify center section header nick Excel Discussion (Misc queries) 1 September 6th 06 09:30 PM
Find the first Value in a Row and Retrieve the Header for That Column efernandes67 Excel Discussion (Misc queries) 1 January 18th 06 10:23 PM
Named Range in Center Header Joel Mills Excel Programming 6 January 5th 05 08:03 PM


All times are GMT +1. The time now is 05:39 AM.

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"