Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. -- Regards, Tom Ogilvy "Eric" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Trim works fine for me, what code are you using -- kkkni ----------------------------------------------------------------------- kkknie's Profile: http://www.excelforum.com/member.php...nfo&userid=754 View this thread: http://www.excelforum.com/showthread.php?threadid=26522 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Eric,
An example of a macro using TRIM http://www.mvps.org/dmcritchie/excel/join.htm#trimall If it doesn't work you will have to determine what characters you actually have see the topic above that one. Also check to see what you get ="*" & A1 & "*" ="*" & TRIM(A1) & "*" =CODE(A1) --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Eric" wrote 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do you remove trailing spaces withour Trim function? | Excel Discussion (Misc queries) | |||
Trim function to remove blank spaces in Excel | Excel Discussion (Misc queries) | |||
Trim Leading Spaces | Excel Worksheet Functions | |||
trim leading spaces | Excel Discussion (Misc queries) | |||
How to trim spaces from entered text in cell using exisiting functions? | Excel Worksheet Functions |