After fiddling around a bit I've managed to "compress" the previous macro. The string "sNam" contains the letters for the columns you wish to trim. Should you wish to trim other columns just change the letters in "sNam".
Option Explicit
Sub TrmTst()
Dim i As Long, j As Long, k As Long
Dim sNam As String, sL As String
With ActiveSheet.UsedRange
i = .Rows(.Rows.Count).Row
End With
sNam = "BHKNQSY"
For j = 1 To Len(sNam)
sL = Mid(sNam, j, 1)
For k = 1 To i
With Range(sL & k)
.Value = WorksheetFunction.Trim(.Value)
End With
Next
Next
End Sub
Alf
Bookmarks