Retrieve Center Header String

K

Ken Hudson

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
 
R

Rick Rothstein

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

Ken Hudson

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

sHeader=PageSetup.CenterHeader

doesn't work?
 
K

Ken Hudson

orry Rick, I got it. I needed:

sHeader=ActiveSheet.PageSeetup.CenterHeader

My apologies.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top