Hello,
Why don't you see if this works ...
Sub SummarizeMyData()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
On Error Resume Next
Dim tmpWs As Worksheet, origWs As Worksheet, rngDescp As Range
Dim rngTmp As Range
Dim cel As Range, rng As Range, wf, fSpace As Long, i As Long
Set origWs = ActiveSheet
origWs.Range("E:F").ClearContents
Set wf = Application.WorksheetFunction
Set rngDescp = origWs.Range("B1:B" & origWs.Range("B65536").End(xlUp).Row)
Set tmpWs = Worksheets.Add
rngDescp.AdvancedFilter action:=xlFilterCopy, _
copytorange:=tmpWs.Range("A1"), unique:=True
If Err <> 0 Then
MsgBox "There was a problem with your ranges!", vbInformation, "ERROR"
Err.Clear
Exit Sub
End If
Set rng = tmpWs.Range("A2:A" & tmpWs.Range("A65536").End(xlUp).Row)
For Each cel In rng
For i = 1 To Len(cel.Value) Step 1
Select Case Mid(cel.Value, i, 1)
Case Is = " ", Chr(32), Chr(160)
fSpace = i
Exit For
End Select
Next i
If fSpace <> 0 Then
cel.Value = Trim(Left(cel.Value, fSpace))
Else 'No space, leave alone
End If
Next cel
Set rngTmp = tmpWs.Range("A1:A" & tmpWs.Range("A65536").End(xlUp).Row)
rngTmp.AdvancedFilter action:=xlFilterCopy, _
copytorange:=tmpWs.Range("B1"), unique:=True
For i = 1 To tmpWs.Range("B65536").End(xlUp).Row Step 1
origWs.Range("E" & i).Value = tmpWs.Range("B" & i).Value
If i <> 1 Then
origWs.Range("F" & i).Formula = "=COUNTIF(B:B,E" & i & "&""*"")"
End If
Next i
tmpWs.Delete
Application.DisplayAlerts = True
Application.ScreenUpdating = True
MsgBox "Complete!"
End Sub
(As posted at MrE as well.)