Sqr Function

 

Sqr(num)

 

Returns the square root of a number.

 

The parameter num must be a valid number greater than or equal to zero.

 

Example:

 

          Sub Form_Click ()

              Dim Msg, Number  ' Declare variables.

              Msg = "Enter a non-negative number."

              Number = InputBox(Msg)  ' Get user input.

              If Number < 0 Then

                 Msg = "Cannot determine the square root of a negative number."

              Else

                 Msg = "The square root of " & Number & " is "

                 Msg = Msg & Sqr(Number) & "."

              End If

              MsgBox Msg ' Display results.

  

          End Sub