macro to eliminate spaces between words

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

Guest

i've a book full of references made wrong , for example the correct refernce
is FFF and in my book i've F F F. It's possible with a macro eliminate this
spaces?
Help me please. My book has 10 pages all wrong:(

Thanks
 
Csam

Public Sub Strip_WhiteSpace()
Selection.Replace What:=" ", _
Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
End Sub

Note: will remove ALL whitespace before, between and after.

Gord Dibben Excel MVP
 
Thanks. I'll try this way.

Gord Dibben said:
Csam

Public Sub Strip_WhiteSpace()
Selection.Replace What:=" ", _
Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
End Sub

Note: will remove ALL whitespace before, between and after.

Gord Dibben 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

Back
Top