Multiple Contional Formatting

G

Guest

MY PROBLEM IS THAT I used drop down when i select the name jhe the color
does not change please help.

If you could give me other macro I would appreciate it.
Thanks


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim icolor As Integer
If Not Intersect(Target, Range("A1:c10")) Is Nothing Then
Select Case Target
Case "jhe"
icolor = 6
Case "mikoy"
icolor = 22
Case "mik"
icolor = 7
Case "gina"
icolor = 53
Case "gary"
icolor = 15
Case "fen"
icolor = 42
Case Else
'Whatever
End Select
Target.Interior.ColorIndex = icolor
End If
End Sub
 
B

Bob Phillips

Excel97?

If so, set a cell to point at the DD cell, and test that in the Calculate
event

Private Sub Worksheet_Calculate()
Dim icolor As Integer
With Worksheets("Sheet1").Range("H1")
Select Case .Value
Case "jhe"
icolor = 6
Case "mikoy"
icolor = 22
Case "mik"
icolor = 7
Case "gina"
icolor = 53
Case "gary"
icolor = 15
Case "fen"
icolor = 42
Case Else
'Whatever
End Select
.Interior.ColorIndex = icolor
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top