View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default trimming whitespace

sStr = Application.Substitute(Application.Substitute(str1 ," ",""),chr(9),"")

demo'd from the immediate window:

sStr1 = "cat " & vbTab & " " & vbTab & vbTab & " " & vbtab & "dog"
? sStr1
cat dog
? Application.Substitute(Application.Substitute(sStr 1," ",""),chr(9),"")
catdog

--
Regards,
Tom Ogilvy




"Jamie Martin" wrote in message
...
Can I trim all whitespace from a string, turning "cat<any number of

spaces,
plus if possible any number of tabsdog" into "catdog"?