+ Operator

[This is preliminary documentation and subject to change.] 

Used to sum two numbers.

Syntax

result = expression1+expression2

The + operator syntax has these parts:

Part Description
Result Required; any numeric variable.
Expression1 Required; any expression.
Expression2 Required; any expression.

Remarks

When you use the + operator, you may not be able to determine whether addition or string concatenation will occur.

The following rules apply:

If Then
Both expressions are numeric Add.
Both expressions are String Concatenate.
One expression is a numeric data type and the other is any data type except Null Add.
One expression is a String and the other is any data type except Null Concatenate.
One expression is an Empty data type Return the remaining expression unchanged as result.
One expression is a numeric data type and the other is a String A Type mismatch error occurs.
Either expression is Null The result is Null.

Example

MyNumber = 2 + 2 ' Returns 4.
MyNumber = 4257.04 + 98112 ' Returns 102369.04.