Yields the difference between two numbers or indicates the negative value of a numeric expression.
expression1 expression2
number
The result will be the difference between number1 and number2.
Byte, Short, Integer, Long, Single, Double, Decimal
In Syntax 1, the operator is the arithmetic subtraction operator for the difference between two numbers. In Syntax 2, the operator is the unary negation operator for the negative value of an expression. The data type of the result is the same as that of the data type with the greatest range. The order of range, from least to greatest range, is Byte, Short, Integer, Long, Single, Double, and Decimal.
If an expression is stated as Nothing, it is treated as zero.
This example uses the - operator to calculate and return the difference between two numbers.
Dim myResult As Double myResult = 4-
2 ' Returns 2. myResult = 459.35-
334.90 ' Returns 124.45.
-= Operator | Arithmetic Operators | Operator Precedence in Visual Basic | Operators Listed by Functionality |