Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Header Font size

Can someone point an old man in the right direction here. I am setting a
header font size and using a variable for the header text. This works just
fine:

Dim strAddress As String

Sub Header()
strAddress = "Main St"
Worksheets("Sheet1").PageSetup.CenterHeader = "&24" & strAddress
End Sub

But when there is a number in the string, the font size becomes huge, as in
this:

Dim strAddress As String

Sub Header()
strAddress = "48 Main St"
Worksheets("Sheet1").PageSetup.CenterHeader = "&24" & strAddress
End Sub

Is it syntax or dimmed wrong?

Mike F


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 222
Default Header Font size

It would seem that the second figure i.e. the address is also being
interpreted as a font size. Try using strAddress = " 48 Main Street" (space
after the first ")
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Header Font size

I got that same impression, but I am not sure why??? Since the strAddress
comes from a textbox the following code works, thanks to your suggestion.

Dim strAddress As String

Sub Header()
strAddress = "48 Main St"
strAddress = " " & strAddress
Worksheets("Sheet1").PageSetup.CenterHeader = "&24" & strAddress
End Sub

Mike F

"bigwheel" wrote in message
...
It would seem that the second figure i.e. the address is also being
interpreted as a font size. Try using strAddress = " 48 Main Street"
(space
after the first ")



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Header Font size

Better yet, put the space right after the font size number:

Sub Header()
strAddress = "48 Main St"
Worksheets("Sheet1").PageSetup.CenterHeader = "&14 " & strAddress
End Sub

Mike F

"Mike Fogleman" wrote in message
...
I got that same impression, but I am not sure why??? Since the strAddress
comes from a textbox the following code works, thanks to your suggestion.

Dim strAddress As String

Sub Header()
strAddress = "48 Main St"
strAddress = " " & strAddress
Worksheets("Sheet1").PageSetup.CenterHeader = "&24" & strAddress
End Sub

Mike F

"bigwheel" wrote in message
...
It would seem that the second figure i.e. the address is also being
interpreted as a font size. Try using strAddress = " 48 Main Street"
(space
after the first ")





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Font color based on font type or size John Excel Discussion (Misc queries) 2 February 7th 08 12:50 AM
Change all text one font size up with various font sizes used. omchrystal New Users to Excel 2 March 6th 07 09:01 PM
My tabs' font size is smaller - how do I restore default size? katykins53 Excel Discussion (Misc queries) 1 January 11th 06 12:07 AM
Dropdown list for font size, font type and number formats ExcelMonkey[_190_] Excel Programming 1 March 9th 05 03:50 PM
Change Header Font Size Bret Excel Programming 2 October 27th 04 04:19 PM


All times are GMT +1. The time now is 10:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"