#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Excel 2000

Ive received a spreadsheet that has the addresses in one cell, separated by
commas. Ive used Text to columns Delimited Comma to split these into
four different cells. The problem is that at the beginning of the three new
cells there is a space before the text. Is there any way to delete all these
spaces other than going into each cell and deleting?

Thanks.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200701/1

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Excel 2000

Sandra

You could use the worksheet function TRIM in 3 helper columns by entering
=TRIM(cellref) and dragging across and down then pasting as values and deleting
the original 3 columns but the fastest way would be with a macro run on all 3
columns at once.

Sub TRIM_EXTRA_SPACES()
Dim cell As Range
For Each cell In Selection
If (Not IsEmpty(cell)) And _
Not IsNumeric(cell.Value) And _
InStr(cell.Formula, "=") = 0 _
Then cell.Value = Application.Trim(cell.Value)
Next
End Sub


Gord Dibben MS Excel MVP

On Fri, 12 Jan 2007 22:53:31 GMT, "Sandra via OfficeKB.com" <u5657@uwe wrote:

I’ve received a spreadsheet that has the addresses in one cell, separated by
commas. I’ve used Text to columns Delimited Comma to split these into
four different cells. The problem is that at the beginning of the three new
cells there is a space before the text. Is there any way to delete all these
spaces other than going into each cell and deleting?

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Excel 2000

Thank you so much.

Gord Dibben wrote:
Sandra

You could use the worksheet function TRIM in 3 helper columns by entering
=TRIM(cellref) and dragging across and down then pasting as values and deleting
the original 3 columns but the fastest way would be with a macro run on all 3
columns at once.

Sub TRIM_EXTRA_SPACES()
Dim cell As Range
For Each cell In Selection
If (Not IsEmpty(cell)) And _
Not IsNumeric(cell.Value) And _
InStr(cell.Formula, "=") = 0 _
Then cell.Value = Application.Trim(cell.Value)
Next
End Sub

Gord Dibben MS Excel MVP

IÂ’ve received a spreadsheet that has the addresses in one cell, separated by
commas. IÂ’ve used Text to columns Delimited Comma to split these into

[quoted text clipped - 3 lines]

Thanks.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200701/1

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Excel 2000

If you are not concerned about internal spaces, just use Find/Replace to
remove them.
--
Gary''s Student
gsnu200701


"Sandra via OfficeKB.com" wrote:

Ive received a spreadsheet that has the addresses in one cell, separated by
commas. Ive used Text to columns Delimited Comma to split these into
four different cells. The problem is that at the beginning of the three new
cells there is a space before the text. Is there any way to delete all these
spaces other than going into each cell and deleting?

Thanks.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200701/1


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
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
opening excel 2003 files with excel 2000?? Dave F Excel Discussion (Misc queries) 2 September 21st 06 04:53 PM
Excel 5 and Excel 2000 question. Naveen Mukkelli Excel Discussion (Misc queries) 1 March 3rd 06 09:05 AM
Excel 2000 problem copying drawingobjects between sheets SiriS Excel Discussion (Misc queries) 0 February 8th 06 10:31 AM
Excel 2000 file when opened in Excel 2003 generates errors? Doug Excel Discussion (Misc queries) 13 December 25th 04 10:20 PM


All times are GMT +1. The time now is 07:21 AM.

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

About Us

"It's about Microsoft Excel"