View Single Post
  #3   Report Post  
Peter Rooney
 
Posts: n/a
Default

You could select the range of cells containing the values then run this
little macro...

Sub TrimStrings()
Dim TrimCell As Object
For Each TrimCell In Selection
TrimCell.Value = Trim(Str(TrimCell.Value))
Next TrimCell
End Sub

Hope this helps

Pete



"FernW" wrote:

I have a column of numbers that were imported from a web site and they won't
sort correctly. I have tried reformatting the cells as general numbers but
that doesn't change anything. I discovered that numbers below 100 have a
space or invisible data in front of the number. If I remove it, the number
then shifts to right alignment in the cell and will sort as a number. Is
there any way I can remove these spaces from all numbers at once instead of
going down the column row by row?