add a space into a string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to add a space to a name string ex: Doe;John
The space needs to be applied after the ; but everything that I have tried
so far has not worked. Can anyone assist me with this? Many thanks for your
help.
Kim
 
k said:
I am trying to add a space to a name string ex: Doe;John
The space needs to be applied after the ; but everything that I have tried
so far has not worked. Can anyone assist me with this? Many thanks for
your
help.
Kim

Left([yourstring], Instr([yourstring], ";")) & " " & Mid([yourstring],
Instr([yourstring], ";") + 1)

Tom Lake
 
Debug.Print Left("Doe;John",InStr(1,"Doe;John",";")-1)& "; " &
Trim(Mid("Doe;John",InStr(1,"Doe;John",";")+1))
 
Old habits die hard. There's a much simpler way with the Replace function.

Debug.Print Replace("Doe;John",";", "; ")
 
Jerry Whittle said:
Old habits die hard. There's a much simpler way with the Replace function.

Debug.Print Replace("Doe;John",";", "; ")

Augh! I fell into the trap as well.

Tom Lake
 
Thanks it worked! I needed the extra help.

Kim

Jerry Whittle said:
Old habits die hard. There's a much simpler way with the Replace function.

Debug.Print Replace("Doe;John",";", "; ")
 
Back
Top