+ Reply to Thread
Results 1 to 6 of 6

VBA script conditional formatting - change cell color

  1. #1
    Registered User
    Join Date
    02-09-2016
    Location
    Bucharest
    MS-Off Ver
    2013
    Posts
    53

    Thumbs up VBA script conditional formatting - change cell color

    Hello,

    I need some help with script that can fill the cell color based on a single criteria.
    In Sheet1 i have columns A - Capital, column B - Country.
    In Sheet2 i have 4 columns: A - Africa (with a list of African countries), B - America (with a list of American countries), C - Europe (with a list of European countries), D - Australia (containing other countries AU, NZ etc)

    Now,
    all the countries from Sheet1 column B to be colored separately, based on the column where exists in Sheet2. If the country is found in Sheet2 column A, then, in sheet1, cell A333 to be colored in red according to the country from B333.
    If the country is in column B, then in Sheet 1, cell A99 should take a different color (blue) according to the country from B99.
    A333 and A99 are random examples.

    Can you please help me with this script?

    Thank you in advance

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

    Re: VBA script conditional formatting - change cell color

    Please upload a worksheet so that we can develop a solution for you that works without having to build a brand new worksheet which is very time consuming
    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

  3. #3
    Registered User
    Join Date
    02-09-2016
    Location
    Bucharest
    MS-Off Ver
    2013
    Posts
    53

    Re: VBA script conditional formatting - change cell color

    ohhh, my mistake

    sure, here attached is the Excel file
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA script conditional formatting - change cell color

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-09-2016
    Location
    Bucharest
    MS-Off Ver
    2013
    Posts
    53

    Re: VBA script conditional formatting - change cell color

    this is great!

    thank you very much.

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA script conditional formatting - change cell color

    You're welcome. Glad to help out and thanks for the feedback and the reps.

+ 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. Replies: 22
    Last Post: 03-08-2016, 08:19 PM
  2. Conditional formatting to detect cell with hyperlink and then to change color
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-12-2013, 11:32 AM
  3. Replies: 5
    Last Post: 12-07-2013, 02:21 PM
  4. Replies: 5
    Last Post: 09-24-2013, 03:42 PM
  5. [SOLVED] Script which allows user to define the color in conditional formatting
    By PariD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2012, 03:55 PM
  6. Replies: 5
    Last Post: 05-10-2012, 10:49 PM
  7. Replies: 3
    Last Post: 08-16-2006, 09:00 AM
  8. Replies: 2
    Last Post: 08-26-2005, 01:05 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