Try this:
Let's say the range in question is A1:A10, you might want to change it.
Put this code in the sheet code window.

Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
        If Target.Cells.Count = 1 Then
        Application.EnableEvents = False
        Target.Value = Trim(Target.Value)
        Application.EnableEvents = True
        End If
    End If
End Sub