+ Reply to Thread
Results 1 to 3 of 3

Font size in header

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    111

    Font size in header

    I'm displaying cell contents in the header and all is fine with the exception of the left header. Please see attached pic. For some reason the cell contents, which are in a date format, fill the sheet and even if I alter the font size remain distorted. If I leave them in their default size it works okay.

    Sub TE_Add()
    '
    ' TE_Add Macro
    '
    'Add active sheet to each sheets's header
        Dim ws As Worksheet
        For Each ws In ActiveWorkbook.Worksheets
             ws.PageSetup.LeftHeader = "&26" & ActiveSheet.Range("J2").Value
                 ws.PageSetup.CenterHeader = "&26New Order"
            ws.PageSetup.RightHeader = "&26" & ActiveSheet.Range("D2").Value
    Next ws
    End Sub
    Any ideas?
    Attached Images Attached Images
    Last edited by Steven811; 04-22-2010 at 10:40 AM. Reason: Solved

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: Font size problem in header

    You need a space or the first part of the date is treated as part of the font size.
    Sub TE_Add()
    '
    ' TE_Add Macro
    '
    'Add active sheet to each sheets's header
        Dim ws As Worksheet
        For Each ws In ActiveWorkbook.Worksheets
             ws.PageSetup.LeftHeader = "&26 " & ActiveSheet.Range("J2").Value
                 ws.PageSetup.CenterHeader = "&26New Order"
            ws.PageSetup.RightHeader = "&26 " & ActiveSheet.Range("D2").Value
    Next ws
    End Sub
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    111

    Re: Font size problem in header

    Ha, I never spotted that. Thanks

+ 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