Skip to content

Latest commit

 

History

History
62 lines (41 loc) · 2.4 KB

File metadata and controls

62 lines (41 loc) · 2.4 KB
title keywords f1_keywords ms.assetid ms.date ms.localizationpriority
* operator
vblr6.chm1008844
vblr6.chm1008844
f45e939e-ff1d-c152-ad82-099e8f00ee8c
11/19/2018
medium

* Operator

Used to multiply two numbers.

Syntax

result = number1 * number2

The * operator syntax has these parts:

Part Description
result Required; any numeric variable.
number1 Required; any numeric expression.
number2 Required; any numeric expression.

Remarks

The data type of result is usually the same as that of the most preciseexpression. The order of precision, from least to most precise, is Byte, Integer, Long, Single, Currency, Double, and Decimal.

The following are exceptions to this order:

If Then result is
Multiplication involves a Single and a Long Converted to a Double.
The data type of result is a Long, Single, or Date variant that overflows its legal range Converted to a Variant containing a Double.
The data type of result is a Byte variant that overflows its legal range Converted to an Integer variant.
The data type of result is an Integer variant that overflows its legal range Converted to a Long variant.

If one or both expressions are Null expressions, result is Null. If an expression is Empty, it is treated as 0.

Note

The order of precision used by multiplication is not the same as the order of precision used by addition and subtraction.

Example

This example uses the * operator to multiply two numbers.

Dim MyValue
MyValue = 2 * 2    ' Returns 4.
MyValue = 459.35 * 334.90     ' Returns 153836.315.

See also

[!includeSupport and feedback]