+ Reply to Thread
Results 1 to 3 of 3

Making code recognise conditional formatting

  1. #1
    Registered User
    Join Date
    04-04-2013
    Location
    Darwin Australia
    MS-Off Ver
    Excel 2010
    Posts
    36

    Making code recognise conditional formatting

    Hello
    I have just recently been helped with code to transfer rows of information with red font (a date in column D) to a target sheet (same workbook) by a very helpful member here. It works great when i change the font manually.
    However, after using conditional formatting to change the cells to a red font the code doesnt recognise it and no information gets transferred to the target sheet. (thought id give my previous expert assistant a break )

    Any suggestions

    Thanks

    The code i am using:

    Please Login or Register  to view this content.

  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: Making code recognise conditional formatting

    You can't really do that, detect the "RESULTS" of a conditional formatting rule on a cell. Only the applied properties of the cells are exposed to VBA for testing. But you shouldn't do it that way even if you could.

    A rule of thumb for you needs to be Color is not data. Coloring is something you apply to a cell to draw human attention. For Excel, you simply have to teach your VBA the same logic you put in your CF rules and have VBA do the same tests in another way.

    For instance, perhaps your rule colors all the cells in column F "red" that have the word "Yes" or "Complete" in them. You could have VBA apply and autofilter to that same column to show only the YES/COMPLETE cells in that column, then "do your stuff" on the remaining visible rows.

    So, in short, whatever logic you used to make the cells red, tell Excel THAT logic and it can do the same thing for you, color irrelevant.
    _________________
    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
    Registered User
    Join Date
    04-04-2013
    Location
    Darwin Australia
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Making code recognise conditional formatting

    Hi JBeaucaire
    I understand now what I need to do, thanks for the help

    Regards

    Craig

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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