Closed Thread
Results 1 to 2 of 2

Macro for finding and changing cell colors

  1. #1
    Registered User
    Join Date
    05-19-2021
    Location
    Czechia
    MS-Off Ver
    O365, 16.0
    Posts
    6

    Exclamation Macro for finding and changing cell colors

    Hello,

    I'm working on a large data file where on a monthly basis I have to check for any errors. I'm wanting to write a macro that allows for the following:

    IF row G does not contain the value from E
    OR row G does not contain the value from F
    OR row G does not contain "[at]email.com"
    Then change the cell color to purple

    To clarify: E contains FirstName, F contains LastName, G contains emailadress with firstname.lastname[at]email.com. I'm looking for errors in the emailadress, where it may have been misspelled or the wrong format was used.

    I'm not allowed to make permanent changes with formulas so cannot use vlookup/hlookup etc in the sheet itself, therefore I'm looking for a VBA code that will let me change the colors. I will then write an IF-ELSE, so I can undo my color-coding before saving the file.

    What would be the best way to write this in VBA?

    Thanks!

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: Macro for finding and changing cell colors

    Closed. OP has posted in CS.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 02-27-2018, 12:59 AM
  2. [SOLVED] Changing colors macro cells
    By Berna11 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-11-2016, 06:06 PM
  3. Changing cells and column chart colors based on cell colors
    By HDeuce in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-03-2016, 11:43 AM
  4. Automatically changing cell colors
    By matoex in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2015, 09:17 AM
  5. Replies: 3
    Last Post: 10-21-2015, 03:51 PM
  6. Replies: 1
    Last Post: 08-01-2014, 10:33 AM
  7. Changing row colors when value in cell changes
    By silky_green in forum Excel General
    Replies: 5
    Last Post: 10-12-2005, 08:54 AM

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