I set up sets of 4 named ranges with "_1" through "_4" for several data items that pertain to quarterly processing.
for example:
CurrentMilestone_1, CurrentMilestone_2, etc
PassedAsOf_1, PassedAsOf_, etc
ok- so I need to color 4 cells with red, yellow or green based upon how many tests passed for that milestone...for troubleshooting, I am just using messageboxes as placeholders:
For i = 1 To 4
Select Case CStr(Application.Range("PassedQuarter_" & i).Text)
Case CStr(Application.Range("YellowThreshold_" & i).Text) To CStr(Application.Range("GreenThreshold_" & i).Text) - 1
MsgBox ("YELLOW! " & i)
Case Is >= CStr(Application.Range("GreenThreshold_" & i))
MsgBox ("GREEN! " & i)
Case Else
MsgBox ("RED! " & i)
End Select
Next
problem-
when the select/case statement evaluated a value of 3, it came up with GREEN when the greenthreshold was 21 and the yellowthreshold was 18- I think it is dealing with them as text instead of integers.
I tried to add cint and then switched to Cstr functions to make this work. Cstr is the right choice since cint returns type mismatch
Also tried "+0" to force the mnamed range values to be treated as numbers- result: type mismatch
Any help? thank you
for example:
CurrentMilestone_1, CurrentMilestone_2, etc
PassedAsOf_1, PassedAsOf_, etc
ok- so I need to color 4 cells with red, yellow or green based upon how many tests passed for that milestone...for troubleshooting, I am just using messageboxes as placeholders:
For i = 1 To 4
Select Case CStr(Application.Range("PassedQuarter_" & i).Text)
Case CStr(Application.Range("YellowThreshold_" & i).Text) To CStr(Application.Range("GreenThreshold_" & i).Text) - 1
MsgBox ("YELLOW! " & i)
Case Is >= CStr(Application.Range("GreenThreshold_" & i))
MsgBox ("GREEN! " & i)
Case Else
MsgBox ("RED! " & i)
End Select
Next
problem-
when the select/case statement evaluated a value of 3, it came up with GREEN when the greenthreshold was 21 and the yellowthreshold was 18- I think it is dealing with them as text instead of integers.
I tried to add cint and then switched to Cstr functions to make this work. Cstr is the right choice since cint returns type mismatch
Also tried "+0" to force the mnamed range values to be treated as numbers- result: type mismatch
Any help? thank you