ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Function =Trim() (https://www.excelbanter.com/excel-worksheet-functions/229263-function-%3Dtrim.html)

Dowitch

Function =Trim()
 
I've been using Trim to delete extra spaces from fields that contain imported
data. Today I tried to use it on data that I'd copied from a webpage and
inserted into a spreadsheet, but it wouldn't take off the blanks after the
numbers. Am I mis-using the function? These were numbers that I'd copied as
a bulk which 'self-segregated' into individual cells. I then re-copied them
changing from colums to rows using Paste-Special. Then I tried to use Trim,
but it had no effect. I needed to remove the spaces so that I could divide
the numbers by 100.

T. Valko

Function =Trim()
 
copied from a webpage

More than likely, these are not standard char 32 space characters but are
html non-breaking space characters, char 160. TRIM/CLEAN will not remove
them.

Instead of using a formula on every cell I recommend you try this macro and
do it in bulk. I copy/paste stuff from the web every day and have to deal
with this.

There is a macro at this link that will remove these char 160 space
characters:

http://www.mvps.org/dmcritchie/excel/join.htm#trimall

--
Biff
Microsoft Excel MVP


"Dowitch" wrote in message
...
I've been using Trim to delete extra spaces from fields that contain
imported
data. Today I tried to use it on data that I'd copied from a webpage and
inserted into a spreadsheet, but it wouldn't take off the blanks after the
numbers. Am I mis-using the function? These were numbers that I'd copied
as
a bulk which 'self-segregated' into individual cells. I then re-copied
them
changing from colums to rows using Paste-Special. Then I tried to use
Trim,
but it had no effect. I needed to remove the spaces so that I could
divide
the numbers by 100.





All times are GMT +1. The time now is 10:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com