VBA String Operators

VBA String Operators

String data is used to hold data that is made up of numbers, characters, and symbols. “Jul-2015” is an example of a string data. It is made up of

  • Characters (Jul)
  • Symbol (-)
  • Numbers (2015)

String operators are used to manipulate string data. For example, you can concatenate the value of July-2015 from the first 3 letters of the month and the year like “Jul-2015”.

The following table shows the concatenation string operator.

S/NOperatorDescriptionExampleOutput
1&Concatenate: This operator is used to concatenate strings together“John ” & “Doe”John Doe

Example Source Code

MsgBox “John ” & “Doe”, vbOKOnly, “Concatenate Operator”

Executing the above code produces the following result

Download the above Excel Code

Source: https://www.guru99.com/vba-string-operators.html

1 Trackback / Pingback

  1. Microsoft Excel Training Tutorial: Learn in 7 Days – 20geninfo

Leave a Reply

Your email address will not be published.


*