Add a char to string

  • Thread starter Thread starter Alan Fisher
  • Start date Start date
A

Alan Fisher

I know this should be easy but I can not find a function
that will simply add a char to a string. I need to add
a "T" to a string variable in VBA. For instance if the
variable = "1150" i want to make it = "T1105". Thanks for
your help.
 
Alan Fisher said:
I know this should be easy but I can not find a function
that will simply add a char to a string. I need to add
a "T" to a string variable in VBA. For instance if the
variable = "1150" i want to make it = "T1105".

Is it "1150" or "1105"? I assume one is a typo, and that it makes no
difference to the actual question.
Thanks for your help.

Use the & operator for string concatenation. For example:

Dim strMyString As String

strMyString = "1150"
strMyString = "T" & strMyString
 
Back
Top