Conditional Formatting

  • Thread starter Thread starter Viscount
  • Start date Start date
V

Viscount

2 things....

1. - I have got a list that is linked to a cell - when a
paticular item in the list is chosen I want the cell to be
filled with a colour - i.e. Conditional Formatting -
however how do I allow for more than 3 conditional
formats - there are about 7 choices from the list.

2. - Linking from the above - I then want the rest of hte
information in that row to be coloured the same as box in
problem 1. I cannot seem to get the Conditional Formatting
to work for this..?

Any ideas..?

Thanks

Vis.
 
You'll have to use some VBA code to do this. Add this to
the worksheet module (right click the sheet tab and choose
View Code..)

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$5" Then
'only run if D5 changed
Select Case Target.Value
Case "xxx"
Range("A5:G5").Interior.ColorIndex = 1
Case "yyy"
Range("A5:G5").Interior.ColorIndex = 2
Case "zzz"
Range("A5:G5").Interior.ColorIndex = 3
'add more statements...
Case Else
Range("A5:G5").Interior.ColorIndex = 0
End Select
End If
End Sub

Cheers,
Dave.
 
Back
Top