Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default how do I remove leading spaces and leave the remianing spaces w

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


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 698
Default how do I remove leading spaces and leave the remianing spaces w

Try the TRIM function:

With
B16: " find the spaces"

C16: =TRIM(B16)
Returns "find the spaces"....without the quotes, of course.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


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


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 733
Default how do I remove leading spaces and leave the remianing spaces w

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.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default how do I remove leading spaces and leave the remianing spaces

Thank you I used the option from the Data Menu and it works perfectly
providing the exact results I want.

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


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default how do I remove leading spaces and leave the remianing spaces

This worked however it return the data to the cell the formua is in. It would
work if there was a small amount of data to correct however I have a large
listing to remove intermittal leading blanks.
My desire results is to have the range of data corrected remaining in their
original cells.
Is this possible?

"Ron Coderre" wrote:

Try the TRIM function:

With
B16: " find the spaces"

C16: =TRIM(B16)
Returns "find the spaces"....without the quotes, of course.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


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




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default how do I remove leading spaces and leave the remianing spaces

While the option from the data menu worked could you please explain How the
Replace function works as well as what each peice of the formula represents.

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


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trim Leading Spaces Steven Excel Worksheet Functions 6 February 21st 07 11:21 PM
Removing leading/trailing spaces Chuda Excel Discussion (Misc queries) 2 September 12th 06 04:20 PM
trim leading spaces captain bob Excel Discussion (Misc queries) 2 August 3rd 06 02:57 PM
How do I add leading spaces to a value? Chris Brown Excel Worksheet Functions 3 March 3rd 06 05:23 PM
Remove Leading Spaces Kirk P. Excel Discussion (Misc queries) 3 March 3rd 05 01:30 PM


All times are GMT +1. The time now is 06:24 AM.

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

About Us

"It's about Microsoft Excel"