trimming a space in the middle of a string

  • Thread starter Thread starter thomas donino
  • Start date Start date
T

thomas donino

I have a list of names in one column. I want to trim the space from the
middle so that Jim Jones looks like JimJones. Any help?

Thank You
 
VBA solution

Msgbox Replace("Jim Jones",chr(32),"")

If this post helps click Yes
 
Highlight the column and press Ctrl + H for find & replace - replace " " with
"" (you don't need to type the quotation marks, they're just so you can see
what I've typed)
 
Since you posted in programming group.

Public Sub Strip_WhiteSpace()
Selection.Replace what:=" ", _
replacement:="", lookat:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
End Sub


Gord Dibben MS Excel MVP
 

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

Similar Threads

Using Trim in a Userform 12
trim not working 2
trim, chr(10) 24
trim 3
Trim function in macro 2
Removing spaces is driving me nuts 8
Regular Expressions & Middle Name 7
Trim Entire Column 3

Back
Top