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/N | Operator | Description | Example | Output |
---|---|---|---|---|
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
Leave a Reply Cancel reply