Trim spaces on both sides

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
 
T

Tom Ogilvy

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

Top