Just additionally to this topic, recently I got the issue that Replace(" ","") and Trim() were not having effect on data coming from Excel so I had to add the other replaces:
Replace(Text, Chr(160), Chr(32))
Replace(Text, Chr(9), Chr(32))
And then I did Trim(Text)