Thanks Gord,
That great!
"Gord Dibben" <gorddibbATshawDOTca> wrote in message
news:(E-Mail Removed)...
> Private Sub Worksheet_Change(ByVal Target As Range)
> Dim R As Range
> Dim iColor As Long
> Set R = Range("A1:A100")
> If Intersect(Target, R) Is Nothing Or Target.Count > 1 Then Exit Sub
> Vals = Array("A", "B", "C", "D")
> Nums = Array(8, 9, 6, 3)
> For i = LBound(Vals) To UBound(Vals)
> If UCase(Target.Value) = Vals(i) Then iColor = Nums(i)
> Next
> With Target
> .Offset(0, 1).Interior.ColorIndex = iColor
> .Offset(0, 3).Interior.ColorIndex = iColor
> End With
> End Sub
>
> Note: you could do this with Conditional Formatting.........default color
> for a and three others for b, c, d
>
> If using Excel 2007 you have many more conditions.
>
>
> Gord Dibben MS Excel MVP
>
> On Tue, 16 Dec 2008 20:50:25 -0000, "MM User" <(E-Mail Removed)>
> wrote:
>
>>Hi,
>>
>>I have in column A options: a,b,c or d
>>
>>depending on what is chosen is it possible change the background color of
>>the relevant row in B and C?
>>
>>i.e. if a3 = a then b3 & d3 background is red or
>>if a3 = b then b3 & d3 background is green etc
>>
>>If possible is it possible to do this automatically i.e. not run a macro
>>just on a cell change in A?
>>
>>Thanks!
>
|