Subtraction Operator (-) (VBScript)

Finds the difference between two numbers or indicates the negative value of a numeric expression.

' Example 1
result = number1-number2
' Example 2


Any numeric variable.


Any numeric expression.


Any numeric expression.


Any numeric expression.

In Syntax 1, the - operator is the arithmetic subtraction operator used to find the difference between two numbers. In Syntax 2, the - operator is used as the unary negation operator to indicate the negative value of an expression.

If one or both expressions are Null expressions, result is Null. If an expression is Empty, it is treated as if it were 0.

Community Additions