A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

deleting spaces



 
 
Thread Tools Display Modes
  #1  
Old June 13th, 2004, 04:17 PM
Continental Translations
external usenet poster
 
Posts: n/a
Default deleting spaces

In a column of cells, tha majority of cells have spaces before the text. As
there are over 500 cells, is there any easy way to delete these spaces? As
there are spaces in between words within these cells, I don't want to delete
all spaces, but just the first one which comes in front of the text.



  #2  
Old June 13th, 2004, 04:44 PM
David McRitchie
external usenet poster
 
Posts: n/a
Default deleting spaces

Hi Continental............,
Suggest using the TRIMALL macro
http://www.mvps.org/dmcritchie/excel/join.htm#trimall

And if you got the material from an HTML page then they
probably are CHAR(160) nonbreaking space (&nbsp
rather than actual spaces Char(32), both of which are covered
in the macro.
---
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

"Continental Translations" wrote in message ...
In a column of cells, tha majority of cells have spaces before the text. As
there are over 500 cells, is there any easy way to delete these spaces? As
there are spaces in between words within these cells, I don't want to delete
all spaces, but just the first one which comes in front of the text.






  #3  
Old June 13th, 2004, 04:54 PM
Ragdyer
external usenet poster
 
Posts: n/a
Default deleting spaces

You could try using a "helper" column with a formula to eliminate leading
and trailing spaces.
Then, you delete the formula, and leave the revised data behind.

With data starting in A1, enter this in B1:

=TRIM(A1)

Now, select B1, and double click on the "fill handle" (little black square)
in the lower right corner of the selected cell.

This will copy the formula down column B, as far as there is data in column
A.

Now, while column B is *still* selected, right click in the selection and
choose "Copy".
Right click *again* in the selection, and choose "PasteSpecial".
Choose "Values", then OK.

You now have column B with your revised data, where you may delete the
original column if desired.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Continental Translations" wrote in message
...
In a column of cells, tha majority of cells have spaces before the text.

As
there are over 500 cells, is there any easy way to delete these spaces? As
there are spaces in between words within these cells, I don't want to

delete
all spaces, but just the first one which comes in front of the text.




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.