Results 1 to 6 of 6

Thread: my crayons don't work! (RESOLVED)

  1. #1

    Thread Starter
    Lively Member TheFIDDLER's Avatar
    Join Date
    May 2002
    Location
    here and there and far away
    Posts
    126

    my crayons don't work! (RESOLVED)

    Anyone know how to change the font color on the page headings in a multipage in Excel?

    I can change the caption, but can't seem to find a color property for the text.

    Seems to work with a tabstrip, anyone know if this exists for a multipage?
    Last edited by TheFIDDLER; Apr 25th, 2004 at 05:57 PM.
    -----
    #VBA, VB 6 Professional Edition, Office XP Developper. Excel 97, Excel 2000, Excel XP

    I miss my VIC 20.
    Never should have upgraded to my commodore 64. ...

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    Your talking about the Page Header in the page setup dialogue?
    There is no access to the font color for page headers/footers.
    This is all that is available - again I am on 2003 so if you don't
    have these in Excel 97 then I don't know.
    Code:
    Format code - Description 
    &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. 
    &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. 
    &P          = Prints the page number. 
    &P+         = number Prints the page number plus the specified number. 
    &P-         = number Prints the page number minus the specified number. 
    &&          = Prints a single ampersand. 
    & "fontname"= Prints the characters that follow in the specified
                  font. Be sure to include the double quotation marks. 
    &nn         = Prints the characters that follow in the specified font size. 
                  Use a two-digit number to specify a size in points. 
    &N          = Prints the total number of pages in the document.
    VB Code:
    1. Sub FormatPageHeaderFooter()
    2.  
    3.     With ActiveSheet.PageSetup
    4.         .LeftHeader = "&""Arial,Bold""&12Font color test"
    5.         '.LeftHeader = "&D" 'PRINTS CURRENT DATE
    6.         .CenterHeader = ""
    7.         .RightHeader = ""
    8.         .LeftFooter = ""
    9.         .CenterFooter = ""
    10.         .RightFooter = ""
    11.         .LeftMargin = Application.InchesToPoints(0.75)
    12.         .RightMargin = Application.InchesToPoints(0.75)
    13.         .TopMargin = Application.InchesToPoints(1)
    14.         .BottomMargin = Application.InchesToPoints(1)
    15.         .HeaderMargin = Application.InchesToPoints(0.5)
    16.         .FooterMargin = Application.InchesToPoints(0.5)
    17.         .PrintHeadings = False
    18.         .PrintGridlines = False
    19.         .PrintComments = xlPrintNoComments
    20.         .PrintQuality = -3
    21.         .CenterHorizontally = False
    22.         .CenterVertically = False
    23.         .Orientation = xlPortrait
    24.         .Draft = False
    25.         .PaperSize = xlPaperLetter
    26.         .FirstPageNumber = xlAutomatic
    27.         .Order = xlDownThenOver
    28.         .BlackAndWhite = False
    29.         .Zoom = 100
    30.         .PrintErrors = xlPrintErrorsDisplayed
    31.     End With
    32.     ActiveWindow.SelectedSheets.PrintPreview
    33.    
    34. End Sub
    Or maybe use a colored picture of text?
    VB Code:
    1. Sub InsertPicture()
    2.  
    3.     With ActiveSheet.PageSetup.LeftHeaderPicture
    4.         .FileName = "C:\Sample.jpg"
    5.         .Height = 275.25
    6.         .Width = 463.5
    7.         .Brightness = 0.36
    8.         .ColorType = msoPictureGrayscale
    9.         .Contrast = 0.39
    10.         .CropBottom = -14.4
    11.         .CropLeft = -28.8
    12.         .CropRight = -14.4
    13.         .CropTop = 21.6
    14.     End With
    15.     ' Enable the image to show up in the left header.
    16.     ActiveSheet.PageSetup.LeftHeader = "&G"
    17.  
    18. End Sub
    Oh, just a thought, what about changing the
    default color for all Excel and then color all your cells back to
    black. This will leave the custom color on the page headers?
    Guess it needs testing in 97.

    HTH
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Lively Member TheFIDDLER's Avatar
    Join Date
    May 2002
    Location
    here and there and far away
    Posts
    126
    Thanks for the reply.

    I was referring to a multipage control, found in the standard VBA control box for use in a form. It has tabs called Page 1, Page 2, Page 3, etc.. I can rename these tabs, but can't quite figure out how to set font colors.
    -----
    #VBA, VB 6 Professional Edition, Office XP Developper. Excel 97, Excel 2000, Excel XP

    I miss my VIC 20.
    Never should have upgraded to my commodore 64. ...

  4. #4
    New Member
    Join Date
    Apr 2004
    Posts
    12
    The multipage's forecolor property will change the text color. In order to change this property, make sure you have the multipage control selected and not a specific page within the control.

    Unfortunately, this color will be used on every page.


    Hope this helps.

  5. #5

    Thread Starter
    Lively Member TheFIDDLER's Avatar
    Join Date
    May 2002
    Location
    here and there and far away
    Posts
    126
    Thank you - did exactly what I was looking for.
    -----
    #VBA, VB 6 Professional Edition, Office XP Developper. Excel 97, Excel 2000, Excel XP

    I miss my VIC 20.
    Never should have upgraded to my commodore 64. ...

  6. #6

    Thread Starter
    Lively Member TheFIDDLER's Avatar
    Join Date
    May 2002
    Location
    here and there and far away
    Posts
    126
    You know, when you think about it, M$ should have worded their properties a bit better.

    I would associate a Forecolor property with the actual color of the form, or the multistrip page within the form.

    And I agree, you have to be very specific in only selecting the multistrip, and not a page within the multistrip.

    Thanks again for the help.
    -----
    #VBA, VB 6 Professional Edition, Office XP Developper. Excel 97, Excel 2000, Excel XP

    I miss my VIC 20.
    Never should have upgraded to my commodore 64. ...

Posting Permissions

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



Click Here to Expand Forum to Full Width