Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / October 2004

Tip: Looking for answers? Try searching our database.

trim

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mtress - 11 Oct 2004 23:13 GMT
I have a field of data imported from another application.  All data is
prefixed by a space.  How can I get rid of this space?  I saw in help
something about 'trim' but how do I use it?  Thanks.
Gord Dibben - 12 Oct 2004 00:28 GMT
TRIM Function can be used with actual text or a cell reference.

=TRIM("  two spaces  ") returns the text "two spaces"(no quotes) with no
leading or trailing spaces.

=TRIM(cellref) returns whatever is in cellref and strips leading and trailing
spaces.

Assuming column A to have a range of these data.

In B1 enter  =TRIM(A1)

Drag/copy down to bottom of Column A range.

Select column B and Copy then Paste Special(in place)>Values>Ok>Esc.

Delete original Column A.

Gord Dibben Excel MVP

>I have a field of data imported from another application.  All data is
>prefixed by a space.  How can I get rid of this space?  I saw in help
>something about 'trim' but how do I use it?  Thanks.
mtress - 12 Oct 2004 12:55 GMT
Thanks for your help.  Unfortunately, its still not working.  Could the
problem be the program (a 'custom' warehouse database program) that I'm
getting the info from?
mtress

> TRIM Function can be used with actual text or a cell reference.
>
[quoted text clipped - 19 lines]
> >prefixed by a space.  How can I get rid of this space?  I saw in help
> >something about 'trim' but how do I use it?  Thanks.
David McRitchie - 12 Oct 2004 22:11 GMT
You probably have a required blank space (  in HTML).  You could
convert them to spaces  manually  by   using  Alt+0160  on numeric keypad,
or if you have a laptop  Fn+Alt+0160 on the numeric keypad.

But it is a lot easier to install a macro into your personal.xls  and use it anytime
you need it.    See     TrimALL in
   http://www.mvps.org/dmcritchie/excel/join.htm#trimall
instructions at the top of the page point you to
   http://www.mvps.org/dmcritchie/excel/getstarted.htm
if you are not already familiar with installing and using macros.

Whether you install the macro or not instructions to find out what you have
can be found at the above location (#trimall   and  #debugformat)

---
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

"mtress" <mtress@discussions.microsoft.com> wrote in message ..
> Thanks for your help.  Unfortunately, its still not working.  Could the
> problem be the program (a 'custom' warehouse database program) that I'm
> getting the info from?

> > TRIM Function can be used with actual text or a cell reference.
> >
> > >I have a field of data imported from another application.  All data is
> > >prefixed by a space.  How can I get rid of this space?  I saw in help
> > >something about 'trim' but how do I use it?  Thanks.
Gord Dibben - 12 Oct 2004 23:16 GMT
HTML has a habit of leaving junk in cells.  Non-breaking spaces for one.

To clean up the junk you can use TRIM and CLEAN and Edit>Replace if you know
which character it is.

Download Chip Pearson's CELLVIEW add-in from

http://www.cpearson.com/excel/CellView.htm

Load through Tools>Add-ins.

Select the data and Chip's add-in will show you what the characters are.

If carriage returns you may be able to Replace them using ALT + 0010 or 0013

Most likely David McRitchie's TRIMALL macro will be of greatest assistance.
Cleans up what TRIM and CLEAN miss.

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

Gord Dibben Excel MVP

>Thanks for your help.  Unfortunately, its still not working.  Could the
>problem be the program (a 'custom' warehouse database program) that I'm
[quoted text clipped - 24 lines]
>> >prefixed by a space.  How can I get rid of this space?  I saw in help
>> >something about 'trim' but how do I use it?  Thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.