Script for triming selected area for EXCEL in VBA
'------------------------------------------------------
' Procedure : MyTrim
' Date : 25.10.2013
' Author : Martins Dumbris
' Purpose : Trim selected range
'------------------------------------------------------
Sub MyTrim()
Dim MyRange As Range
Set MyRange = Selection
For Each cell In MyRange
y = cell.Value
x = Application.WorksheetFunction.Trim(y)
cell.Value = x
Next cell
End Sub