View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default how do I remove leading spaces and leave the remianing spaces w

Data|text to columns will remove trailing spaces, too.
(Doesn't sound like a problem for the OP, though.)

Harlan Grove wrote:

Debi wrote...
I am attempting to remove any leading spaces should there be any
within a range of cells
Example:

In Cell B16 " find the spaces"
in Cell B17 " Must leave other spaces"
In Cell B18 "May have no leading spaces"

The only spaces I would want to eliminate are the ones before
"find...." and "Must.."


With formulas,

=REPLACE(B16,1,FIND(LEFT(TRIM(B16),2),B16)-1,"")

This will remove only the leading spaces, not trailing spaces or
sequences of multiple spaces within the text.

With menu commands, select B16:B18, run Data Text to Columns, select
Fixed Width, click the Next button, remove *ALL* the break lines by
double clicking on them, then click the Finish button. This is a
useful Excel quirk when parsing single fields.


--

Dave Peterson