Add a char to string

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.
 
D

Dirk Goldgar

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top