Consulting

Results 1 to 7 of 7

Thread: Solved: Prevent background color from printing

  1. #1
    VBAX Newbie
    Joined
    Apr 2006
    Location
    One of two Beverly Hills in MI
    Posts
    3
    Location

    Solved: Prevent background color from printing

    Is there some code I can stick in (VBA) that would prevent (turn off) any of the background colors from printing when a user clicks a print button (macro)? I want to use a dark color for screen, but having a black page print out is not too helpful. I guess I could change the screen update, background color to none, print out, then reset the back ground, but where there might be varied light background colors (that already are near clear or light grey at worst in print) it will become a pain...

  2. #2
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    Why not have a Printing Sheet, all you need then is a very simple macro to copy the Screen Sheet and paste Special Values to the Printing sheet, print it and clear it. This can all be done by recording macro as you do it.

  3. #3
    VBAX Regular
    Joined
    Jun 2004
    Posts
    36
    Location
    This line in your VBA will make it print out just B&W:
    [VBA] ActiveSheet.PageSetup.BlackAndWhite = True[/VBA]

    There are a lot of other printing controls that you can add, including headers, footers, etc etc - the easiest way is to start a macro recording & go thru the File menu to Page Setup, & work that till it's the way you like it. You'll end up with a full set of options in a 'With... End With' group.

  4. #4
    VBAX Newbie
    Joined
    Apr 2006
    Location
    One of two Beverly Hills in MI
    Posts
    3
    Location
    Folks, THANK-YOU.

    I really thought that the only thing would happen with the BlackAndWhite property would be the darker color backgrounds would come in as one heck of a lot of black toner! Should I switch it back to False at the end of the routine or is it one of those that only effect the current operation?

  5. #5
    VBAX Regular
    Joined
    Jun 2004
    Posts
    36
    Location
    No problem.

    I think you will find that that is actually sheet-specific - i.e. if that is set to print B&W, the other sheets will still print in glorious colour, unless you tell them differently.

    As far as thinking it would behave differently, I can only say Experiment. You can't really break anything (especially if you're in an experimental copy of your spreadsheet), and it's frequently a faster way to get your answer than hunting on the 'net.

  6. #6
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    Quote Originally Posted by brucemc
    Should I switch it back to False at the end of the routine...?
    Yes.
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  7. #7
    Moderator VBAX Master geekgirlau's Avatar
    Joined
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,464
    Location
    Hi Bruce,

    I've marked this thread as Solved for you - normally you can use the "Thread Tools" option at the top of the screen, but it's not working at present.

Posting Permissions

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