View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
John Tjia John Tjia is offline
external usenet poster
 
Posts: 32
Default Set background color of a cell in VBA

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).


"Cindy" wrote in message ...
That was one of my first thoughts but there is no criteria
for a "null" cell.
-----Original Message-----
Cindy,

You might want to use the Conditional Formatting tool on

the
Format menu to do this.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Cindy" wrote in message
...
Thanks to all that replied. It works.

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.

Thanks

Cindy
-----Original Message-----
Cindy,

Try something like the following.

Range("A1").Interior.ColorIndex = 6 'yellow


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Cindy" wrote in message
...
Anyone know how to change the background color of a

cell
in Excel 2000 VBA code? Thank you

Cindy


.



.