\ Operator

See Also1NOOGUD              Example1DQH9ET>Low

Used to divide two numbers and return an integer result.


result = operand1 \ operand2


The operands can be any numeric expression71RISN.

Before division is performed, the operands are rounded to Integer or Long expressions.

Usually, the data type3GYXY7 of result is an Integer, a Long, or a Variant8PHEAW3 of VarType7A68ZTZ 2 (Integer) or VarType 3 (Long) regardless of whether or not result is a whole number.  Any fractional portion is truncated.  However, if any operand is a Null1DDW7C0, result is also a Null.  Any operand that is Empty1L2JEZ4 (VarType 0) is treated as 0.

See Also

Arithmetic OperatorsSH0K1B

Comparison OperatorsNRJZ1K

Concatenation Operators2MYTW1K

Logical Operators1CQVUTN

Operator Precedence23082A9

Other Operators2HA580P

VarType FunctionXRZH1Y

\ Operator Example

The example divides 100,000 by 7 using integer division and returns 14,285.  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 Result As Double                        ' Declare variable.

   Result = 100000 \ 7                         ' Divide numbers.

   MsgBox "100000 divided by 7 is " & Result   ' Display results.

End Sub