Try:
Code:
Sub RemoveSpaces()
Dim oTable As Table, acell As Cell, oRng As Range
For Each oTable In ActiveDocument.Tables
With oTable
For Each acell In oTable.Range.Cells
Set oRng = acell.Range
With oRng
.End = .End - 1
While .Characters.Last = " "
.Characters.Last = ""
Wend
While .Characters.First = " "
.Characters.First = ""
Wend
End With
Next acell
End With
Next oTable
End Sub
PS: When posting code, please use the code tags. They're on the 'Go Advanced'
tab at the bottom of this screen. Your post tried to replicate them as <CODE></CODE>, whereas the tags here use [ and ] instead of < and >.