__See Also__ __Syntax 1 Example__ __Syntax 2 Example__

Used to find the difference between two numbers or to indicate the negative value of an operand.

**Syntax 1**

*result* = *operand1* **-** *operand2*

**Syntax 2**

-*number*

**Remarks**

In Syntax 1, the **-** operator is the arithmetic subtraction operator used to find the difference between two numbers. The operands can be any __numeric expression__ .

The __data type__ of *result* is usually the same as that of the most precise operand. The order of precision, from least to most precise, is **Integer**, **Long**, **Single**, **Currency**, **Double**. The following are exceptions to this order:

When subtraction involves a **Single** and a **Long**, the data type of *result* is converted to a **Double**.

When the data type of *result* is a **Variant** of __VarType__ 3 (**Long**), VarType 4 (**Single**), or VarType 7 (Date) that overflows its legal range, *result* is converted to a **Variant** of VarType 5 (**Double**).

When the data type of *result* is a **Variant** of VarType 2 (**Integer**) that overflows its legal range, *result* is converted to a **Variant** of VarType 3 (**Long**).

If one or both operands are ** Null** expressions,

In Syntax 2, the **-** operator is used as the unary negation operator to indicate the negative value of an operand. As with Syntax 1, the operand can be any numeric constant, variable, expression, or any function that returns a number.

__Arithmetic Operators__

__Comparison Operators__

__Concatenation Operators__

__Logical Operators__

__Operator Precedence__

__Other Operators__

__VarType____ Function__

The example subtracts a user-supplied number from 1000 and displays the result To try this example, paste the code into the Declarations section of a form. Then press F5 and click the form.

Sub Form_Click ()

Dim N As Double, Result As Double ' Declare variables.

N = InputBox ("Enter a number.") ' Get a number.

Result = 1000 -N

MsgBox "1000 minus " & N & " is " & Result ' Display result.

End Sub

The example uses the **-** operator to indicate a negative value of a number. To try this example, paste the code into the Declarations section of a form. Then press F5 and click the form.

Sub Form_Click ()

Dim N As Double, MinusN As Double ' Declare variables.

N = InputBox("Enter a number") ' Get a number.

MinusN = -N ' Use negation operator.

MsgBox "Negative " & N & " is " & MinusN ' Display result.

End Sub