Hi All,
i have below macro using. But what i need is instead of giving the keyword like Extreme, medium, low or something. can anyone please let me know how can i use aggregate percentage for each cell... like given on below given condition and i need to make 4 columns like a, b, c & d at once in single macro.
Condition:
[pre]
[/pre]
i have below macro using. But what i need is instead of giving the keyword like Extreme, medium, low or something. can anyone please let me know how can i use aggregate percentage for each cell... like given on below given condition and i need to make 4 columns like a, b, c & d at once in single macro.
Condition:
[pre]
Code:
(A+B) >= 90% = Purple
90% >(A+B)>= 80% = Green
80% >(A+B)>= 70% = Yellow
(A+B) < 70% = Orange
Macro:
Private Sub Worksheet_Change(ByVal Target As Range)
Set MyPlage = Range("A1:A1000")
For Each Cell In MyPlage
If Cell.Value = "Extreme" Then
Cell.Interior.ColorIndex = 3
End If
If Cell.Value = "High" Then
Cell.Interior.ColorIndex = 4
End If
If Cell.Value = "Medium" Then
Cell.Interior.ColorIndex = 18
End If
If Cell.Value = "Low" Then
Cell.Interior.ColorIndex = 6
End If
If Cell.Value <> "Extreme" And Cell.Value <> "High" And Cell.Value <> "Medium" And Cell.Value <> "Low" Then
Cell.Interior.ColorIndex = xlNone
End If
Next
End Sub