ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Working with headers in pagesetup (https://www.excelbanter.com/excel-programming/327569-working-headers-pagesetup.html)

OkieViking

Working with headers in pagesetup
 
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

William[_2_]

Working with headers in pagesetup
 
Hi Okie

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

-----
XL2003
Regards

William




"OkieViking" wrote in message
...
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




Mike Fogleman

Working with headers in pagesetup
 
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
"OkieViking" wrote in message
...
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





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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com