Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Font in Header - @22 "25 Miles" goes to 409 font
Hello,
MS EXCEL 2003 in XP PRO (Actually controlled from vba in access 03) Hello. I am trying to set the header in vba for the print area in excel. The code is right but the problem is if the variable starts with a number. ..CenterHeader = "&""Copperplate Gothic Bold,Bold""&22" & CStr(in_ChecklistName & " Checklist") if in_ChecklistName starts with a number, it contributes to the font size. So if in_ChecklistName = "25 Mile Drive" then it behaves as if the code read like so. ..CenterHeader = "&""Copperplate Gothic Bold,Bold""&2225"" Mile Drive" Which obviously causes the header font to go HUGE. What can I do to fix this? Note: works perfectly if the in_ChecklistName variable starts with a letter. Thanks. -- BlueWolverine MSE - Mech. Eng. Go BLUE! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Font in Header - @22 "25 Miles" goes to 409 font
put a space between the characters:
..CenterHeader = "&""Copperplate Gothic Bold,Bold""&22 " _ & CStr(in_ChecklistName & " Checklist") or ..CenterHeader = "&""Copperplate Gothic Bold,Bold""&22" & " " _ & CStr(in_ChecklistName & " Checklist") I'd drop the cStr() stuff. VBA will see it as a string since you're concatenating strings ..CenterHeader = "&""Copperplate Gothic Bold,Bold""&22 " _ & in_ChecklistName & " Checklist" BlueWolverine wrote: Hello, MS EXCEL 2003 in XP PRO (Actually controlled from vba in access 03) Hello. I am trying to set the header in vba for the print area in excel. The code is right but the problem is if the variable starts with a number. .CenterHeader = "&""Copperplate Gothic Bold,Bold""&22" & CStr(in_ChecklistName & " Checklist") if in_ChecklistName starts with a number, it contributes to the font size. So if in_ChecklistName = "25 Mile Drive" then it behaves as if the code read like so. .CenterHeader = "&""Copperplate Gothic Bold,Bold""&2225"" Mile Drive" Which obviously causes the header font to go HUGE. What can I do to fix this? Note: works perfectly if the in_ChecklistName variable starts with a letter. Thanks. -- BlueWolverine MSE - Mech. Eng. Go BLUE! -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Standard font in a "New Microsoft Excel Worksheet.xls" wont change | Excel Discussion (Misc queries) | |||
Where is the toolbar with the "bold type", "font type", options | New Users to Excel | |||
Any IF(A2=font color=red", "1", "0") in excel? Or a way to do it? | Excel Discussion (Misc queries) | |||
How do I "conditionally" change font size based on text length? | Excel Programming | |||
How can I make cell A1 a "Y" or "N" depending upon cell A2's font color? Please help. | Excel Programming |