Right now I have this code that was provided to me by one of you guys (thanks!)
It works great if the user enters the value as ie 1.00" - 2.00" however we have some users that like to enter it as ie 1.00" / 2.00". How can I modify the above code to allow both entries to work? No matter what I try, I can't get it.
Thanks
Kenny
Code:
Set rng = Range(nm.Name)
On Error Resume Next
For Each Dn In rng
If rng.Value <> "" Then
Dmin = Val(Trim(Replace(Split(Dn.Offset(, 2), "-")(0), """", "")))
Dmax = Val(Trim(Replace(Split(Dn.Offset(, 2), "-")(1), """", "")))
If InStr(Dn, "-") Then
temp1 = Val(Trim(Replace(Split(Dn, "-")(0), """", "")))
temp2 = Val(Trim(Replace(Split(Dn, "-")(0), """", "")))
Dn.Interior.ColorIndex = IIf(temp1 >= Dmin And temp1 <= Dmax And temp2 >= Dmin And temp2 <= Dmax, 0, 3)
Else
temp = Replace(Dn, """", "")
Dn.Interior.ColorIndex = IIf(temp >= Dmin And temp <= Dmax, 0, 3)
End If
Else: Dn.Interior.ColorIndex = 0
End If
If rng.Offset(, 2).Value = "" Then Dn.Interior.ColorIndex = 0
If rng.Value = "NA" Or rng.Value = "N/A" Or rng.Value = "na" Or rng.Value = "n/a" Or rng.Value = "Na" Or rng.Value = "N/a" _
Or rng.Value = "nA" Or rng.Value = "n/A" Then Dn.Interior.ColorIndex = 0
Next Dn
It works great if the user enters the value as ie 1.00" - 2.00" however we have some users that like to enter it as ie 1.00" / 2.00". How can I modify the above code to allow both entries to work? No matter what I try, I can't get it.
Thanks
Kenny