set header font size using a variable?

S

Seth

I am trying to set the header font size to a variable (I just am using a
constant in this example), but am having no luck getting it to print. I have
tried many attempts but am not getting what I need. So far I get no header
or some other formatting (time, strikethrough, etc). Please help. Thanks in
advance.

FS = 36

..CenterHeader = "&""Times New Roman,Bold" & FS & "ATTACHMENT I"
does not work

..CenterHeader = "&""Times New Roman,Bold""&FSATTACHMENT I"
does not work either
 
T

Tom Ogilvy

If you record a macro you get:

..CenterHeader = "&""Times New Roman,Regular""&36ATTACHMENT I"

so to replace the 36 you need

..CenterHeader = "&""Times New Roman,Regular""&" & FS & "ATTACHMENT I"

the first ampersand after ",Regular" is part of the string, the second is
the concatenation operator
 
K

kraljb

Because it is treating the &'s as part of the string...

You should change it like so...
CenterHeader = "&" & chr(34) & "Times New Roman,Bold&"&chr(34)&" & FS &
"&ATTACHMENT I"

(The Chr(34) returns the double quote to make it easier to read
 

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