* Operator

Used to multiply two numbers.

Syntax

result = operand1 * operand2

Remarks

The operands can be any numeric expression.

The data type3GYXY7 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, Double, Currency.  The following are exceptions to this order:

When multiplication 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, result is a Null.  Any operand that is Empty (VarType 0) is treated as 0.

Arithmetic Operators

Comparison Operators

Concatenation Operators

Logical Operators

Operator Precedence

Other Operators

VarType Function

* Operator Example

The example determines tax on a user-supplied value using the * operator to multiply the user-supplied value by the tax rate of 15%.  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, Tax As Double              ' Declare variables.

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

Tax = .15 * N                               ' Calculate tax.

MsgBox "Tax is " & Tax                      ' Display results.

End Sub