CELL COLOR CHANGE WHEN A LETTER IS TYPE IN A CELL

TOM R

Well-known Member
Joined
Oct 7, 2006
Messages
731
Hi I'm new to this. I have Excel 2002, I need a VBA code to change the color of a cell when a letter is added to that cell. In column D. D3 to D15 the letters A thru G will be added in a random order. There will be a matching letter in that column. So the letters A and A could be blue , B and B yellow, C and C could be green etc... The pairs need to match the same color. I have a random numbers generator macro that I run to change the I letters in that column, also so I don’t know if it could be added to that or 2 macros could be ran. :confused:

EDIT: Changed case - All CAPS is difficult to read - Moderator
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
Welcome to the Board!

If your number generator is based on a formula you could use a Worksheet_Calculate event. If they're changing based on code, you could add a Select Case structure to your code to match pre-defined cell colors to letters A-G (you could also do that with the Calculate event).

Can we see the code or formula that you have now?

Smitty
 

Forum statistics

Threads
1,136,655
Messages
5,677,019
Members
419,668
Latest member
DharmaK

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top