Trim spaces on both sides

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

Hi There,

How do you trim spaces a text in a column content on both
sides say for example leading and trailing spaces before I
save them to a CSV file. I am creating a macro that do
automatically save my file without modifying them manually.

I use TRIM but it didn't work.

TIA
Eric
 
Trim does what you describe. It removes spaces [ chr(32) ] on each end.
Perhaps you have some characters besides chr(32) that look like spaces.
chr(160) for example.

If so, and you use Excel 2000 or later, you could use the replace function
to clean those. You might have to parse out the string and see what you
have.
 

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

Trim help 2
Cell Validation Help 6
trim not working 2
Trim function in macro 2
Trim in VBA 4
removing leading and trailing spaces 1
format a formula to general (not text) 4
How to compress interstitial spaces? 6

Back
Top