S
Sam Kuo
I'm trying to write a function that checks whether an input is a positive
number.
Below is one of Rick Rothstein's examples that he recommands for use in
replacement of IsNumeric. But I need to expand it further so only "positive
whole number or integer" (i.e with or without decimal point) returns true.
While anything else with text, sign or symbol need to return false.
Any help is appreciated.
Function IsNumber(ByVal Value As String) As Boolean
IsNumber = Len(Value) > 0 And Not Value Like "*[!0-9.]*"
End Function
number.
Below is one of Rick Rothstein's examples that he recommands for use in
replacement of IsNumeric. But I need to expand it further so only "positive
whole number or integer" (i.e with or without decimal point) returns true.
While anything else with text, sign or symbol need to return false.
Any help is appreciated.
Function IsNumber(ByVal Value As String) As Boolean
IsNumber = Len(Value) > 0 And Not Value Like "*[!0-9.]*"
End Function