View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Conditional Formatting of one cell based on another using vba

Hi,

select C1 then

format|Conditional format
Formula is
enter the formula
=AND(C1=5,D1="Pass")

Pick your colour
OK

use format painter to paint this into additional cells if required.

Mike

"Dee" wrote:

Hello, I have a worksheet whos data comes from SQL Server db. Autofilter is
turned on. Within the worksheet are many columns. I would like to make
change the backcolor of the cells in column C based on the content of the
cell in column D on the same row (i.e. c1=5 d1='Pass' change backcolor of c1
to Green). There isn't a range of cells because the db gets updated more rows
are added. How do I code this using vba? I would like to enter this in the
sheet activate event.
--
DC