+ Reply to Thread
Results 1 to 4 of 4

Header Font size

  1. #1
    Mike Fogleman
    Guest

    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. #2
    bigwheel
    Guest

    RE: 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. #3
    Mike Fogleman
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #4
    Mike Fogleman
    Guest

    Re: 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" <[email protected]> wrote in message
    news:%[email protected]...
    >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" <[email protected]> wrote in message
    > news:[email protected]...
    >> 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1