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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,264
Members
449,075
Latest member
staticfluids

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
Back
Top