Results 1 to 5 of 5
  1. #1
    4 Star Lounger pccoyle's Avatar
    Join Date
    Apr 2001
    Location
    Auckland, Auckland, New Zealand
    Posts
    535
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Change Font Colour Macro (2002 SP2)

    I have a costing sheet where I want to change the colour of the font prior to printing, then change it back again after printing is completed. I have a line in my macro that reads Selection.Font.ColorIndex = 4. The font colour does not change for the print process, can someone please explain what I need to change for this to work. <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> <img src=/S/flags/NewZealand.gif border=0 alt=NewZealand width=30 height=18>
    Paul Coyle
    Approach love and cooking with reckless abandon

  2. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Change Font Colour Macro (2002 SP2)

    Hi Paul,

    Sub ColourCells()
    For Each oCell In Selection
    oCell.Font.ColorIndex = 4
    Next
    End Sub

    works for me. Changes the font to a pale green. You don't have another colour being applied via conditional formatting do you? That would override the macro's effect.

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change Font Colour Macro (2002 SP2)

    Your code works for me. Do you happen to have set a black and white printer (e.g. a standard B&W laser printer) as printer for the workbook? Or has "Black and White" been ticked in the Sheet tab of the Print Setup dialog?

  4. #4
    4 Star Lounger pccoyle's Avatar
    Join Date
    Apr 2001
    Location
    Auckland, Auckland, New Zealand
    Posts
    535
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Re: Change Font Colour Macro (2002 SP2)

    Hi Hans, The black and white options are not set for either the printer or the sheet. If I manually change the font colout then print it appears as I want it.
    Paul Coyle
    Approach love and cooking with reckless abandon

  5. #5
    4 Star Lounger pccoyle's Avatar
    Join Date
    Apr 2001
    Location
    Auckland, Auckland, New Zealand
    Posts
    535
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Re: Change Font Colour Macro (2002 SP2)

    Thanks Macropod. Boy did I screw Up! <img src=/S/blush.gif border=0 alt=blush width=15 height=15> <img src=/S/blush.gif border=0 alt=blush width=15 height=15> The macro that had the colour change line was not the macro assigned to the print button, boy am I ever embarrassed. Thank you both for your courtesy and replies, my apologies.
    <img src=/S/clever.gif border=0 alt=clever width=15 height=15> <img src=/S/flags/NewZealand.gif border=0 alt=NewZealand width=30 height=18>
    Paul Coyle
    Approach love and cooking with reckless abandon

Posting Permissions

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