A family of Microsoft word processing software products for creating web, email, and print documents.
Tables with the AllowAutoFit setting active when being processed by a macro impose a significant performance hit. Allowing the display to update while the table resizes exacerbates this. Working with selections (which is what your code does with each cell) is also quite inefficient. Try something along the lines of:
Sub Demo()
Application.ScreenUpdating = False
Dim Tbl As Table, TblCll As Cell, bFit As Boolean
For Each Tbl In ActiveDocument.Tables
With Tbl
bFit = .AllowAutoFit
.AllowAutoFit = False
For Each TblCll In .Range.Cells
With TblCll.Range
If .Characters.Last.Previous = " " Then
.HighlightColorIndex = wdDarkRed
End If
While .Characters.Last.Previous = " "
.Characters.Last.Previous = vbNullString
Wend
End With
Next
.AllowAutoFit = bFit
End With
Next
Application.ScreenUpdating = True
End Sub
Note that the above also has a While ... Wend loop to delete the trailing spaces. You can delete/comment-out that or the highlight code.
As coded, the macro processes all tables in the document. If you only want to process one or more selected tables, change ActiveDocument to Selection.