Sgn

Public Function Sgn(ByVal Number As Double) As Double

Returns a number indicating the sign of the specified number. Returns -1 for negative number, 0 for 0-numbers, and 1 for positive numbers.

Public Function NumberAnalysis(pNumber As Double) As String
   Select Case Sgn(pNumber)
   Case -1
       Return "You entered a negative number"
   Case 0
       Returns "You entered zero"
   Case 1
       Return "You entered a positive number"
   End Select
End Function

See also: