Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

-= Operator

Subtracts the value of an expression from the value of a variable and assigns the result to the variable.

variable -= expression

Parts

variable
Required. Any numeric variable.
expression
Required. Any numeric expression.

Example

The following example uses the -= operator to subtract one Integer variable from another and assign the result to the latter variable.

Dim var1 As Integer = 10
Dim var2 As Integer = 3
var1 -= var2   ' The value of var1 is now 7.

See Also

&= Operator | *= Operator | += Operator | - Operator | /= Operator | = Operator | \= Operator | ^= Operator | Assignment Operators | Arithmetic Operators | Operator Precedence in Visual Basic | Operators Listed by Functionality | Assignment Statements

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.