Hi All,
I write this code, does the job but seems long. Is there a shorter way to rewrite this code and still do its job?
Thanks for your help.
Rgds,
splucena
I write this code, does the job but seems long. Is there a shorter way to rewrite this code and still do its job?
Code:
If ActiveSheet.Range("B2").Value = "Red" Then
ActiveSheet.Shapes("shEAC").Fill.ForeColor.RGB = RGB(255, 0, 0)
Else
If ActiveSheet.Range("B2").Value = "Green" Then
ActiveSheet.Shapes("shEAC").Fill.ForeColor.RGB = RGB(0, 255, 0)
Else
If ActiveSheet.Range("B2").Value = "Yellow" Then
ActiveSheet.Shapes("shEAC").Fill.ForeColor.RGB = RGB(255, 255, 0)
Else
If ActiveSheet.Range("B2").Value = "Orange" Then
ActiveSheet.Shapes("shEAC").Fill.ForeColor.RGB = RGB(255, 69, 0)
End If
End If
End If
End If
If ActiveSheet.Range("B3").Value = "Red" Then
ActiveSheet.Shapes("Logged").Fill.ForeColor.RGB = RGB(255, 0, 0)
Else
If ActiveSheet.Range("B3").Value = "Green" Then
ActiveSheet.Shapes("Logged").Fill.ForeColor.RGB = RGB(0, 255, 0)
Else
If ActiveSheet.Range("B3").Value = "Yellow" Then
ActiveSheet.Shapes("Logged").Fill.ForeColor.RGB = RGB(255, 255, 0)
Else
If ActiveSheet.Range("B3").Value = "Orange" Then
ActiveSheet.Shapes("Logged").Fill.ForeColor.RGB = RGB(255, 69, 0)
End If
End If
End If
End If
Thanks for your help.
Rgds,
splucena