+ Reply to Thread
Results 1 to 7 of 7

Can VBA find a cell that meets Conditional Formatting criteria?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    09-21-2014
    Location
    Midwest USA
    MS-Off Ver
    2010
    Posts
    349

    Can VBA find a cell that meets Conditional Formatting criteria?

    I have a workbook that quarterly I update a list of IDs based on changes to their population. In the example workbook attached column A contains the existing IDs and in Column B I import the new values – the list can be up to a couple thousand IDs long. I need to see the changes, so I’ve created conditional formatting rules that highlight miss matches. Anything in the current list that’s no longer in the new import is heighted red for deletion, and anything in the import that needs to be added is highlighted Green. A blue highlight in column means an ID has been duplicated and requires investigation.
    Question – Can I identify which cells in column A are highlighted, either red or blue? Currently I scroll through the list manually, but was wondering if I could click a macro to jump to the next highlighted cell in column A. If this is possible, I would appreciate a suggested direction to investigate – I’m not sure how to start this one and have struck out searching on the internet.
    Attached Files Attached Files

  2. #2
    Forum Contributor kalbasiatka's Avatar
    Join Date
    02-27-2016
    Location
    Brest, Belarus
    MS-Off Ver
    2021
    Posts
    224

    Re: Can VBA find a cell that meets Conditional Formatting criteria?

        If Cells(i, j).Interior.Color = 255 Then 'red
            'some action
        End If
        If Cells(i, j).Interior.Color = 32768 Then 'green
            'some action
        End I
    f
    To do it for me and help me it is 2 different things!
    Sorry for my english, blame Google translator

  3. #3
    Forum Contributor
    Join Date
    09-21-2014
    Location
    Midwest USA
    MS-Off Ver
    2010
    Posts
    349

    Re: Can VBA find a cell that meets Conditional Formatting criteria?

    I like your thinking, unfortunately conditional formatting doesn't change the interior.color value (it's always 16777215), despite what's the display color.

  4. #4
    Forum Contributor kalbasiatka's Avatar
    Join Date
    02-27-2016
    Location
    Brest, Belarus
    MS-Off Ver
    2021
    Posts
    224

    Re: Can VBA find a cell that meets Conditional Formatting criteria?

    walk through the cells and apply the same rules in the conditional formatting in code

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Can VBA find a cell that meets Conditional Formatting criteria?

    Why not just autofilter based on cell color?
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Contributor
    Join Date
    09-21-2014
    Location
    Midwest USA
    MS-Off Ver
    2010
    Posts
    349

    Re: Can VBA find a cell that meets Conditional Formatting criteria?

    In the large list the differences are rarely on the same line, so filtering on one column would hide many of the changes in the other column.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Can VBA find a cell that meets Conditional Formatting criteria?

    You could add a formula that calculates if any of the cells in the row are of interest, and filter on that.

    And if you do that, you could use the same column to control the CF so you don't do it redundantly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Find a value next to a value that meets a criteria
    By vancampc in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 04-11-2016, 08:33 AM
  2. Find first value that meets some criteria
    By Cynthia Moore in forum Excel General
    Replies: 13
    Last Post: 11-07-2015, 10:29 AM
  3. find cell with maximum value that meets a certain criteria
    By shrijan in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 08-12-2015, 06:21 AM
  4. [SOLVED] need to find MAX value IF meets criteria
    By rossg in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-03-2013, 10:58 PM
  5. [SOLVED] find last value in a column if it meets a certain criteria
    By chiidzzz in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-15-2012, 02:19 PM
  6. Find cell that meets criteria
    By dudedude in forum Excel General
    Replies: 5
    Last Post: 07-08-2010, 08:31 AM
  7. [SOLVED] How do I find the last row which meets criteria??
    By colwyn in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-28-2009, 12:34 PM

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