Consulting

Results 1 to 7 of 7

Thread: Conditional Formats - printing a list of formats used

  1. #1
    VBAX Regular
    Joined
    Aug 2006
    Posts
    82
    Location

    Conditional Formats - printing a list of formats used

    I have a number of worksheets that use varying kinds of Conditional Formatting. When creating a similar sheet in a different workbook, I need to be able to use the same CF's, but it's rather tedious and cumbersome to have to remember every little bit of it, and just as bad to bounce back and forth between workbooks, checking every cell to see what the formats are. Is there some code that I can write that will list or print the Conditional Formats of each cell?
    (No two sheets are alike. All of them have the same columns, but they all have different row setups based on unique identifiers. There are also different summary rows with their own formats.)
    All help is appreciated.

  2. #2
    VBAX Expert
    Joined
    Jul 2004
    Location
    Wilmington, DE
    Posts
    600
    Location
    What info exactly are you after? By the time you drill down into all the collections, objects, and properties involved in conditional formatting, you are talking about a couple or a few dozens of data elements...
    Regards,

    Patrick

    I wept for myself because I had no PivotTable.

    Then I met a man who had no AutoFilter.

    Microsoft MVP for Excel, 2007 & 2008

  3. #3
    VBAX Regular
    Joined
    Aug 2006
    Posts
    82
    Location
    Ideally, I want a listing of which cells have conditional formats, what the conditions are for each cell, and the format assigned. Something like this:

    Cell Condition Format
    A12 IF <0 Red shading, white font
    B20 IF <>0 Light blue shading

    Any way that the Condition and Format can be shown would be OK, so long as I can easily tell what they are.

    When doing a Page Setup, you can elect to have comments printed as shown on screen or at the end of the sheet. I would like to have a method that would allow a similar listing of conditional formats at the end of the sheet, or on a separate sheet.

  4. #4
    VBAX Expert
    Joined
    Jul 2004
    Location
    Wilmington, DE
    Posts
    600
    Location
    Getting the list of cells with CF is easy, but you are not being specific enough on the formatting applied. On Excel's CF dialog, the basic categories of "font", "border", and "pattern" look simple enough, but behind the scenes there are potentially many objects and properties involved.

    For example, when you say "Red shading, white font", there are at least two properties in play for the pattern (color and pattern applied), and for the font, there's the font name, italic, bold, size, underline, and color. If you are using borders, each border has its own suite of settings.

    It's more complex than it looks, and so you need to be very specific about what you want--more specific than your last post.
    Regards,

    Patrick

    I wept for myself because I had no PivotTable.

    Then I met a man who had no AutoFilter.

    Microsoft MVP for Excel, 2007 & 2008

  5. #5
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Create a "library" of conditional formats on a hidden sheet. Have a Userform apply your choice to a selection.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  6. #6
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Nifty
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  7. #7
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Not printing, but try this

Posting Permissions

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