View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj bj is offline
external usenet poster
 
Posts: 1,397
Default TRIM not trimming

if there are still apperant spaces you can use code(mid(...)) to identify the
code to use in the char() formula

"Harlan Grove" wrote:

Kim wrote...
....
However, there are leading and trailing spaces in both columns, and
when I used the =TRIM function to remove them, it doesn't work. Even
when I use TRIM in column D, then copy that value into Notepad, I
can still see the spaces.

....

I'd guess your cell data comes from an HTML source, and it contains
nonbreaking spaces (decimal character code 160). You need to replace
them with ASCII/breaking spaces, then apply TRIM.

=TRIM(SUBSTITUTE(x,CHAR(160)," "))