You need to use the Interior property of the Range object:
Range("A1").Interior.Color = ColorValue
ColorValue is a number specifying the color, or you can
use the RGB function RGB(RedValue,GreenValue,BlueValue)
where RedValue,GreenValue, and BlueValue are 0-255. For
example, yellow is pure red and pure green mixed together
or RGB(255,255,0).
Maybe you can help futher. What I need to do is check 8
specific cells on a sheet to be sure they contain a value
before the user can continue. My idea is to change the
color of those cells that are empty - which works. But
now I'm trying to figure out the best way to recheck the
cells and reset the color to white, where I might need to
do this several times, depending if the user actually
entered data in all 8 cells.
Right now I'm using 8 separate If statements to check the
cells for values.
The null condition is the starting condition. So the cell can be
yellow when there is nothing in it, and then the Conditional
Formatting would be white if the cell value is not blank (or vice
versa).
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.