+ Reply to Thread
Results 1 to 4 of 4

Highlight cells if they don't match one of two cells (macro)

  1. #1
    Registered User
    Join Date
    11-04-2011
    Location
    Marlton NJ
    MS-Off Ver
    Excel 2007
    Posts
    8

    Highlight cells if they don't match one of two cells (macro)

    I have a macro that marks correct answers based on the correct value in B2 - B17 and AI2 - AI17 being the wrong answer.
    Also if B2 - B17 is entered incorrectly that cell color turns red. If the answer is correct the cell color turns yellow and is added up at the bottom.

    What my macro does not do is change the cell color to red if C2 - AI2 does not match B2 or AI17. Also if AI2 - AI17 is not entered correctly the cell color should change. Here is the macro. Also a file is attached with the macros. When the changes are made to the macro it should find mistakes in the attached file, some of the cells that are wrong are C2, D2, C3, D3, C15 there are others that are wrong.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    11-04-2011
    Location
    Marlton NJ
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Highlight cells if they don't match one of two cells (macro)

    Anyone have any ideas for this?

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Highlight cells if they don't match one of two cells (macro)

    you dont need a macro to change the cell color, conditional formatting wll do that for you easily.

    see the attached and let me know if that is what you wanted?
    Attached Files Attached Files
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    11-04-2011
    Location
    Marlton NJ
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Highlight cells if they don't match one of two cells (macro)

    Capture.jpgSorry I need to use a macro as conditional format breaks other macros on my excel sheets. This is a small potion of what I do.
    I have attached a picture of what the macro should return when working correctly. I shortened (removed columns) just to make it look better for the example.One thing to remember if C:G do not match B or H they should turn red. If B:H do not match C, C should turn red. If B:H do not match G, G should turn red.
    Attached Images Attached Images
    Last edited by apollo753; 09-20-2012 at 12:11 AM. Reason: wrong picture

+ 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