See Also Example
Used to force string concatenation of two operands.
result = operand1 & operand2
Whenever an operand is a number, it is converted to a Variant The data type3GYXY7 of result is String if both operands are String expressions; otherwise, result is a Variant of VarType 8 (String). If both operands are Null (VarType 1), result is also Null. However, if only one operand is Null, that operand will be treated as a zero-length string when concatenated with the other operand. Any operand that is Empty (VarType 0) is also treated as a zero-length string. of VarType 8 (String).
& Operator Example
The example uses the & operator to concatenate a numeric variable (Var1), a string literal containing a space, and a string variable (Var2) that contains "trombones". 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 Var1, Var2 ' Declare variables.
Var1 = 76
Var2 = "trombones"
MsgBox 76 & " " & Var2 ' Concatenate and display.