Good afternoon, if the number you are trying to determine is negative or positive is in a text box control then you have to turn it into a long or and integer. (will not work normally as it is determined as a string). So instead of using
-
If Text1.Text < 0 Then
-
MsgBox "Negative"
-
ElseIf Text1.Text > 0 Then
-
MsgBox "Positive"
-
Else
-
MsgBox "Is not a number or is 0"
-
End If
-
you have to turn them into Longs or Integers with either Clng or Cint for example
-
If CInt(Text1.Text) < 0 Then
-
MsgBox "Negative"
-
ElseIf CInt(Text1.Text) > 0 Then
-
MsgBox "Positive"
-
Else
-
MsgBox "is not a number or is 0"
-
End If
-
The above code is tried and tested my friend. (ps. you can change it from an Integer to A Long by changing: -
If CInt(Text1.Text) < 0 Then
to
If CLng(Text1.Text) < 0 Then
Hope this helps you
Kind regards
Devon.