+ Reply to Thread
Results 1 to 5 of 5

Increase header font size

Hybrid View

Steven811 Increase header font size 04-21-2010, 03:32 AM
MarMo Re: Increase header font size 04-21-2010, 04:16 AM
Steven811 Re: Increase header font size 04-22-2010, 03:41 AM
MarMo Re: Increase header font size 04-22-2010, 04:07 AM
Steven811 Re: Increase header font size 04-22-2010, 06:29 AM
  1. #1
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    111

    Increase header font size

    Hi

    I wish to increase the font size of the text in my header. This is the code that I've used to generate the text.

    Can anyone help

    Sub TE_Add()
    '
    '
    'Add D2 from active sheet to each sheets's header
        Dim ws As Worksheet
        For Each ws In ActiveWorkbook.Worksheets
                 ws.PageSetup.CenterHeader = "New Order"
            ws.PageSetup.RightHeader = ActiveSheet.Range("D2").Value
        Next ws
    End Sub
    Please note that I have previously posted this in general help and didn't receive any replies and believe that this form is more suitable.
    http://www.excelforum.com/excel-gene...in-header.html

    Thanks
    Steven811
    Last edited by Steven811; 04-22-2010 at 06:30 AM. Reason: Solved

  2. #2
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Re: Increase header font size

    Hi Steven811
    I found these links with some code u could use

    Excelforum : set header font size using a variable?
    http://www.excelforum.com/excel-prog...-variable.html

    Ozgrid : Header, size and font problem
    http://www.ozgrid.com/forum/showthread.php?t=22444

    Hope these help.

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

    Re: Increase header font size

    I've managed to increase the font size of the text that I am displaying 'New Order' but, increasing the size of the cell contents D2 that I'm also wanting to display as the right header header remains a mystery. The code now looks like

                ws.PageSetup.CenterHeader = "&26New Order"
            ws.PageSetup.RightHeader = ActiveSheet.Range("D2").Value
    I've looked at the code that is created when I record a macro but I've been unable to get any of it to work.

    Any ideas?

  4. #4
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Re: Increase header font size

    Steven ,

    Just add the "&26" ( fontsize ) before the range value (see code below)
    there are other format codes for Headers and Footers (see help in Excel)

                Sub TE_Add()
    '
    '
    'Add D2 from active sheet to each sheets's header
        Dim ws As Worksheet
        For Each ws In ActiveWorkbook.Worksheets
                ws.PageSetup.CenterHeader = "&""Arial""&14New Order"
                ws.PageSetup.RightHeader = "&10" & ActiveSheet.Range("D2").Value
        Next ws
    End Sub

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

    Re: Increase header font size

    Perfect, thanks MarMo

+ 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