+ Reply to Thread
Results 1 to 6 of 6

Document (List) All Conditional Formatting Rules in Workbook

  1. #1
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Document (List) All Conditional Formatting Rules in Workbook

    I am creating documentation on a rather complex workbook that contains many Conditional Formatting rules on most worksheets. Is there a VBA way to create a list of all the Conditional Formatting rules in a workbook?

    Ideally, the resulting output would be a new worksheet named CF that has the name of the worksheet in Column A, the actual boolean formulas in Column B, and the range to which the rule applies in Column C.

    Thanks in advance for your suggestions!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Document (List) All Conditional Formatting Rules in Workbook

    This will do it, make sure there is NOT a sheet named CF when you run this, it will create it and format it.

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 03-06-2014 at 08:32 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Document (List) All Conditional Formatting Rules in Workbook

    Wow! Thanks, Jerry. It works perfectly. tom

  4. #4
    Registered User
    Join Date
    05-19-2017
    Location
    Scotland
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Document (List) All Conditional Formatting Rules in Workbook

    Thanks Jerry ,
    Just Tried this in Excel 365 and it worked a Treat.
    Hugh

  5. #5
    Registered User
    Join Date
    08-27-2018
    Location
    UK
    MS-Off Ver
    2010
    Posts
    1

    Re: Document (List) All Conditional Formatting Rules in Workbook

    Excellent, I have tried many fragments of VBA from various forums & this is the first one that has actually worked! thanks!

  6. #6
    Registered User
    Join Date
    01-19-2012
    Location
    Bedford, England
    MS-Off Ver
    2016 / 365
    Posts
    1

    Re: Document (List) All Conditional Formatting Rules in Workbook

    This is a great answer but some care should be taken. Not all Conditional Formats have a 'Formula1' property.

    You can use a Select Case to avoid errors, for example (and by no means exhaustive):

    Please Login or Register  to view this content.
    XlFormatConditionType constants can be found at by searching on MS Docs (can't post a link to the URL!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1