Assign Operators
Syntax
Group
Description
Assign a value to var.
Op |
Description |
= |
Assign the value of expr to var. |
+= |
The same as: var = var + (expr). This language element is not VBA compatible. |
-= |
The same as: var = var - (expr). This language element is not VBA compatible. |
*= |
The same as: var = var * (expr). This language element is not VBA compatible. |
/= |
The same as: var = var / (expr). This language element is not VBA compatible. |
\= |
The same as: var = var \ (expr). This language element is not VBA compatible. |
^= |
The same as: var = var ^ (expr). This language element is not VBA compatible. |
<<= |
The same as: var = var << (expr). This language element is not VBA compatible. |
>>= |
The same as: var = var >> (expr). This language element is not VBA compatible. |
&= |
The same as: var = var & (expr). This language element is not VBA compatible. |
Example
Sub Main
X = 1
X = X*2
Debug.Print X ' 2
End Sub