Thread: Excel 2000
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
sandralong2 via OfficeKB.com sandralong2 via OfficeKB.com is offline
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