The TRIM function removes leading and trailing spaces but not spaces between
words or separate strings in a cell.
Why do you think you still have trailing spaces after using TRIM?
Try this in A1......enter 3 spaces then qwerty then 3 more spaces.
In B1 enter =LEN(A1) should return 10
In A2 enter =TRIM(A1)
In B2 enter =LEN(A2) should return 6
If you are not getting rid of the trailing spaces, perhaps they are HTML
non-breaking spaces....CHAR(160)
You can try edit>replace
what: ALT + 0160(from the numpad)
with: nothing
Replace all.
Gord Dibben MS Excel MVP