Concatenating a String and an Integer in VBA
Solved
Hugo
-
ccm81 Posted messages 11033 Status Membre -
ccm81 Posted messages 11033 Status Membre -
Hello,
When I write:
a = "B" & Str(8)
b = "B" + Str(8)
I get: a -> "B 8" and b -> "B 8"
However, I would like to obtain "B8" without the space.
In my code, I need to generate strings of the form "Bi" where i is an integer.
I don’t understand where that damn space comes from.
Do you have any idea?
When I write:
a = "B" & Str(8)
b = "B" + Str(8)
I get: a -> "B 8" and b -> "B 8"
However, I would like to obtain "B8" without the space.
In my code, I need to generate strings of the form "Bi" where i is an integer.
I don’t understand where that damn space comes from.
Do you have any idea?
a = "B" & i is incorrect and raises a type error
thank you for trim I'm going to use that.