Working with headers in pagesetup

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to add a header as below. However, I want to replace the word "Test"
with a variable. How do I do that and still retain the formatting?

With ActiveSheet.PageSetup
.CenterHeader = "&""Arial,Bold""&14Test"
End With


Thanks
 
Hi Okie

With ActiveSheet.PageSetup
..CenterHeader = "&""Arial,Bold""&14" & _
ActiveSheet.Range("M1")
End With
--

-----
XL2003
Regards

William

(e-mail address removed)
 
Dim myvar
Dim hdr
myvar = ??? 'replace the word "Test"
hdr = "14"& myvar

With ActiveSheet.PageSetup
.CenterHeader = "&""Arial,Bold""&hdr"
End With

Should get you close to what you want
Mike F
 

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

Back
Top