The +=
operator is short form of X = X + Y
The +
operator is usually used for summing number rather than string combination(See Here). Example:
'Setting Values
Dim Var As Integer
Var = 101
'Adding 62 to this number (SHORT FORM)
Var += 62 'This will set Var to 163
'Reset value
Var = 101
'This is standard long form
Var = Var + 62 'This will again set Var to 163
The &=
operator is short form of String1 = String1 & String2
The &
operator is string combination. Example:
'Setting Values
Dim String1 As String
String1 = "coding is "
'combine "Great" to this string (SHORT FORM)
String1 += "Great!" 'This will set String1 to "coding is Great!"
'Reset Value
String1 = "coding is "
'This is standard long form
String1 = String1 & "Great!" 'This will again set String1 to "coding is Great!"