I*m trying to change cell color on value conditions, situation is there are different posts on my work where they pick pcs to put in a pallet
on every station we calculate hours and pcs per hour = pcs:hours=solution
example : ratings are if 120pcs or more per hour is cell color green between : 119pcs and 80pcs a hour cell color is orange less than 80pcs a hour cell color is red
now for many posts my code is working but for some posts it gives me the wrong color why i didn't find
I don't know what is wrong with it
I post the code for Vman all workstations have this some code but just changing the conditions values Vman is 120pcs a hour like i told before other stations can be 2250, 100, 350, 300
and so on most of the stations gives the right result of color
is the code for Vman
If ComboBox1.Text = "Vman" Then
Range("ah10").Font.Color = vbBlack
Range("ah10").Font.Bold = True
Range("ah10").Font.Color = vbBlack
'grijs-Gray
If Range("ah10").Value = "" Then
Range("ah10").Interior.Color = RGB(128, 128, 128)
Range("ah10").Font.Color = vbBlack
'rood-Red
ElseIf Range("ah10").Value < "80" Then
If Range("ah10").Value > "" Then
Range("ah10").Interior.Color = vbRed
Range("ah10").Font.Color = vbWhite
End If
'oranje-Orange
ElseIf Range("ah10").Value >= "80" Then
If Range("ah10").Value < "120" Then
Range("ah10").Interior.Color = RGB(255, 153, 0)
End If
'groen-Green
ElseIf Range("ah10").Value >= "120" Then
Range("ah10").Interior.Color = RGB(146, 208, 80)
End If
End If
If ComboBox1.Text = "Vman 3" Then
Range("ah10").Font.Color = vbBlack
Range("ah10").Font.Bold = True
Range("ah10").Font.Color = vbBlack
'grijs-Gray
If Range("ah10").Value = "" Then
Range("ah10").Interior.Color = RGB(128, 128, 128)
Range("ah10").Font.Color = vbBlack
'rood-Red
ElseIf Range("ah10").Value < "80" Then
If Range("ah10").Value > "" Then
Range("ah10").Interior.Color = vbRed
Range("ah10").Font.Color = vbWhite
End If
'oranje-Orange
ElseIf Range("ah10").Value >= "80" Then
If Range("ah10").Value < "120" Then
Range("ah10").Interior.Color = RGB(255, 153, 0)
End If
'groen-Green
ElseIf Range("ah10").Value >= "120" Then
Range("ah10").Interior.Color = RGB(146, 208, 80)
End If
End If
I don't find the solution for the code the most stations are working and gives me the good color but some don't.