Deleting leading spaces in a cell

D

Dunc Fowler

I have a spreadsheet that is basically a text document.

I have rows of entries that have blank spaces before an entry in the cell.

Is there a way I can delete just those leading spaces or blanks in each
cell?

Thanks

Dunc
 
D

Dave Peterson

Can you get rid of ALL the spaces in the cell?

If yes, select the range
edit|Replace
what: (Spacebar)
with: (leave blank)
replace all

If you can't do the mass change, then you can try this (one column at a time):

Select the column
Data|Text to columns
Fixed width (remove any lines that excel may have guessed)
And finish up the wizard.
(This will get rid of trailing spaces, too.)
 
D

Dunc Fowler

Humph!!!!

Too simple... ;-)

Why didn't I figure that one out!!!

Thanks Dave!

That helped a lot!

Dunc
 
D

David McRitchie

Chances are pretty good that what look like
leading spaces are actually nonbreaking space
characters ( ) in HTML and also know as
required blank (RBL) in word processing.
http://www.mvps.org/dmcritchie/excel/join.htm#trimall
Instructions to install the macro can be found at
http://www.mvps.org/dmcritchie/excel/getstarted.htm#havemacro

If you install the TrimALL macro in your personal.xls
you will be able to invoke it easily from any workbook
to remove the convert required blanks to spaces and
then to remove leading and trailing spaces for a
selection of cells.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top