excel2000-question

  • Thread starter Thread starter piet
  • Start date Start date
P

piet

To make the background color of a cell changes, depending on the value that
is in it, I use conditional format.

Is it also possible to change the background color of some cells, depending
on the value in another cell?

txs
Johan
 
I don't know exactly how to do so, but I'll bet it could be done in VBA.
Have you searched
VBA Help?

Ed
 
you could do conditional formating to test if those cells have something
in them. Or if they don't you could trick it and have a formula linked
in the cells but change the color of the text to be the background
color so it is invisible, then run a conditional test on that data. It
is ugly but works.

Keith
www.kjtfs.com
 
in your conditional formatting, just reference the other cell

cell is equal to another cell.

If you want the condition to be solely dependent on another cell, change the
Cell is dropdown in conditional formatting to formula is. Then put in a
formula that will produce a true or false result in accordance with the
conditions you want to test. Use absolute and relative cell references as
appropriate if you need to format multiple cells.
 
Yes.

Sub ColoredCells()
If Cells(3, 3).Value = "01" Then
Cells(5, 5).Interior.ColorIndex = 1
End If
End Sub

Or....

Sub ColoredCellsVar1()
Dim i As Integer
For i = 1 To 10
If Cells(i, 3).Value = "01" Then
Cells(i, 4).Interior.ColorIndex = 1
End If
Next i
End Sub

Rick

Merry Christmas and Happy Holidays!!!
 
Back
Top