Results 1 to 3 of 3

Thread: Remove conditional formatting before printing

  1. #1

    Remove conditional formatting before printing



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi
    I know this subject has been on here before, being a complete novice most of the solutions are way above my head. I need a nice and simple solution if there is such a thing. I have a wookbook with conditional formatting where workmates fill in required data, if some of these cells are missed for any reason they show the colour. I wish to remove all the colour before printing, then resore it again once printing is finished.

    Hope you can help, remeber (KISS) Keep It Simple Stupid, so that I may follow.

  2. #2
    Super Moderator JeffreyWeir's Avatar
    Join Date
    Mar 2011
    Location
    New Zealand
    Posts
    357
    Articles
    0
    Here's one approach: You create a new named range called "ShowFormatting" and in it you put either "Yes" or "No". You then amend the conditional formatting formulas so that they ALSO check whether that cell has "Yes" in it. http://blog.contextures.com/archives...al-formatting/

  3. #3
    Super Moderator JeffreyWeir's Avatar
    Join Date
    Mar 2011
    Location
    New Zealand
    Posts
    357
    Articles
    0
    You can also have a macro to automatically change the ShowFormatting to "No" while you print, and then change it back. This should do it (although I haven't tested...don't have access to a printer right now).
    Put this in the ThisWorkbook code module.

    Private Sub Workbook_BeforePrint(Cancel As Boolean)
    [ShowFormatting] = "False"
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
    IgnorePrintAreas:=False
    [ShowFormatting] = "True"
    Cancel = True
    End Sub

Posting Permissions

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