i need to check whether a demical is 0 through 49.99 or 50 through 99.99 or 100 through 199.99 or greater than 200. i am trying to do this with select case, but i am not sur
I have my doubts that you've framed this question to say exactly what you mean. Do you really want the first group to encompass just 0 through 49.99? Or do you really mean 0 up to but not including 50, and you simply expect your input to have 2 decimal places or fewer? If you want to group numbers by fifties, say, then it is very strange to write:
Select Case value
Case Is <= 49.99
Debug.WriteLine("49.99 or less")
Case Is <= 99.99
Debug.WriteLine("greater than 49.99, 99.99 or less")
' ... and so on '
End Select
The number 49.995 here falls into the second group, which seems counterintuitive. Picking two decimal places as the cut-off point is arbitrary.
The '<=' operator is not the way to go here; use the '<' operator; it makes a lot more sense:
Select Case value
Case Is < 50
Debug.WriteLine("less than fifty")
Case Is < 100
Debug.WriteLine("fifty or greater, less than 100")
' ... and so on '
End Select