Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
set header font size using a variable?
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
set header font size using a variable?
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 -- Regards, Tom Ogilvy "Seth" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
set header font size using a variable?
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 -- kraljb ------------------------------------------------------------------------ kraljb's Profile: http://www.excelforum.com/member.php...fo&userid=9955 View this thread: http://www.excelforum.com/showthread...hreadid=400911 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
set header font size using a variable?
Great! It works now as intended. Thanks a bunch!
"Tom Ogilvy" wrote: 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 -- Regards, Tom Ogilvy "Seth" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Changing Font color based on font type or size | Excel Discussion (Misc queries) | |||
Change all text one font size up with various font sizes used. | New Users to Excel | |||
Header Font size | Excel Programming | |||
Dropdown list for font size, font type and number formats | Excel Programming | |||
Change Header Font Size | Excel Programming |