just a simple Select case problem,
If I type the "text" or even any text in the Range("B3"), it will fall into "Case >200" statement, that means the answer of C3 is "Excellent"
If I place Case "text" before Case >200, it correctly display TEXT instead of "Excellent"
why any string or text will get into Case >200? they are not a number at all?
If I type the "text" or even any text in the Range("B3"), it will fall into "Case >200" statement, that means the answer of C3 is "Excellent"
If I place Case "text" before Case >200, it correctly display TEXT instead of "Excellent"
why any string or text will get into Case >200? they are not a number at all?
VBA Code:
Sub Simple_Case()
Select Case Range("B3").Value
Case 1 To 200
Range("C3").Value = "Good"
Case 0
Range("C3").Value = ""
Case Is > 200 'cannot place before text otherwise all text belong in this statement
Range("C3").Value = "Excellent"
Case Is = "text"
Range("C3").Value = "TEXT"
Case Else
Range("C3").Value = "Bad"
End Select
End Sub
Last edited by a moderator: