Solved How do I use a macro to change to color of the cell?

June 2, 2014 at 16:41:38
Specs: Windows 7
I know very little about macros, so i really need some help.

I am tryinng to create a macro that will change the cell color (not the font, the actual cell) to yellow if the values within that cell do not comply with a certain format. For example, if the format is suppose to be WOXX.XX.DR.Tes.XX.XX.XX, and the cell values do not comply with that format, It says something like WOXX.Footloop, or something, I want the cell to automatically turn yellow. Indicating non-compliance.

I feel as though conditional formatting will take FOREVER, i was hoping a macro could be quicker.

Pleae help!

See More: How do I use a macro to change to color of the cell?

Report •

June 2, 2014 at 17:37:59
✔ Best Answer
Conditional Formatting can accomplish what you want.

I'm guessing that the letter X in you string


are simply place holders and that they can represent any letter or number.

If this correct then with your data in Column A

Conditional Formatting 2007

1) Select your cell or range of cells. IE A1:A100
2) On the ribbon click Conditional Formatting
3) Click on New Rules, it’s near the bottom of the dialog box.
4) Click Use Formula to determine which cells to format.
5) Enter the formula:


6) Click on the Format button
7) Select the Fill Tab
8) Select a Yellow color
9) Click OK
10) Click OK

See how that work for you.


Report •
Related Solutions

Ask Question