Make the Header/Footer bold
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 7 of 7

Thread: Make the Header/Footer bold

  1. #1
    New Member
    Join Date
    Mar 2002
    Location
    Paul
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Hi All

    Thanks to Dave Hawley for previous code. I now have the following but would like to embolden the text in the header/footer:

    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    If Target.Address = "$A$1" Then
    ActiveSheet.PageSetup.CenterFooter = Range("A1")

    As a complete novice, the Microsoft VB Help File does not seem overly helpful. I have managed to glean that &B should turn bold on but where in the code does it go????

    Ta very much

    Cheers - Paul

  2. #2
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    ActiveSheet.PageSetup.CenterFooter = "&""Arial,Bold""YourText"

    Best regards,
    Allan Chara
    http://www.mrspreadsheets.com

  3. #3
    New Member
    Join Date
    Mar 2002
    Location
    Paul
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks Al,

    The only problem is that I have used a cell reference rather than actual text to be displayed in the footer. It doesn't like the following code:

    ActiveSheet.PageSetup.CenterFooter = Range("&""Arial,Bold""A1")

    Any Thoughts???

    Cheers - Paul

  4. #4
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Not sure, maybe someone else knows.

  5. #5
    Board Regular
    Join Date
    Feb 2002
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-09 08:23, paulyf wrote:
    Thanks Al,

    The only problem is that I have used a cell reference rather than actual text to be displayed in the footer. It doesn't like the following code:

    ActiveSheet.PageSetup.CenterFooter = Range("&""Arial,Bold""A1")

    Any Thoughts???

    Cheers - Paul
    Try this syntax:
    ActiveSheet.PageSetup.CenterFooter = "&""Arial,Bold""" & Range("A1")
    "Interfere? Of course we should interfere! Always do what you're best at, that's what I say!" -- The Doctor, Nightmare of Eden

  6. #6
    Board Regular
    Join Date
    Feb 2002
    Posts
    3,169
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    hi

    Can i ask can anyoner add to this code so poss different colo(u)rs???


    Free Excel based Web Toolbar available here.

    Jack in the UK
    J & R Excel Solutions
    "making Excel work for you"

  7. #7
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    On 2002-04-13 06:31, Jack in the UK wrote:
    hi

    Can i ask can anyoner add to this code so poss different colo(u)rs???
    Hi jack...the colouring formats cannot be used for headers..... formats avail are
    as follows;


    &L Left-aligns the characters that follow.
    &C Centers the characters that follow.
    &R Right-aligns the characters that follow.
    &E Turns double-underline printing on or off.
    &X Turns superscript printing on or off.
    &Y Turns subscript printing on or off.
    &B Turns bold printing on or off.
    &I Turns italic printing on or off.
    &U Turns underline printing on or off.
    &S Turns strikethrough printing on or off.
    &"fontname" Prints the characters that follow in the specified
    font. Be sure to include the quotation marks around
    the font name.
    &nn Prints the characters that follow in the specified
    font size. Use a two-digit number to specify a size
    in points.
    Codes to insert specific data
    -------------------------------------------------------------------
    &D Prints the current date
    &T Prints the current time
    &F Prints the name of the document
    &A Prints the name of the workbook tab (the "sheet name")
    &P Prints the page number
    &P+number Prints the page number plus number
    &P-number Prints the page number minus number
    && Prints a single ampersand
    &N Prints the total number of pages in the document



    Kind Regards,
    Ivan F Moala From the City of Sails

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com