Written by Allen Wyatt (last updated August 16, 2025)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365
When Gina is editing documents created by others, she often needs to remove whitespace (spaces, tabs, hard and soft returns) from the end of cells in a table. She wonders if there is a way to do this with Find and Replace, or if she needs to use a macro to do it.
The answer depends on the information in your tables. If the only whitespace is actual spaces, then you can get rid of them by adjusting the alignment in your table cells. That approach is detailed fully in this WordTip:
https://tips.net/T9994
If you have other whitespace characters besides spaces, then you can try a Find and Replace approach by following these steps:

Figure 1. The Replace tab of the Find and Replace dialog box.
There is one major drawback to using this approach: You need to make sure you don't click Replace All in step 6. If you do, then any trailing whitespace in your entire document is replaced. This may sound like a good thing, but it isn't because hard returns and soft returns are removed, which can end up messing up your formatting. Stepping through one change at a time, however, may give you the results you want.
If you need to strip trailing whitespace quite a bit, you'll get the most satisfactory results by using a macro. Here's an example of one that will do the job:
Sub TrimTableCells()
Dim tbl As Table
Dim cel As Cell
Dim rng As Range
Dim txt As String
Dim sRtxt As String
Dim sMsg As String
If Selection.Information(wdWithInTable) Then
Set tbl = Selection.Tables(1) ' current table
' Loop through each cell in the table
For Each cel In tbl.Range.Cells
Set rng = cel.Range
' Exclude the end-of-cell marker
rng.End = rng.End - 1
' Remove trailing whitespace
txt = RTrim(rng.Text)
sRtxt = Right(txt, 1)
Do While sRtxt = " " Or sRtxt = Chr(9) Or sRtxt = Chr(11) Or sRtxt = Chr(13)
txt = Left(txt, Len(txt) - 1)
sRtxt = Right(txt, 1)
Loop
rng.Text = txt
Next cel
sMsg = "Trailing whitespace and returns removed from all cells."
Else
sMsg = "The insertion point is not inside a table."
End If
MsgBox sMsg, vbInformation
End Sub
Just place the insertion point with a table and then run the macro. It looks for any whitespace characters—spaces, tabs, soft returns, and hard returns—at the end of each table cell and, if it finds one, it deletes the character.
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (6200) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365.
Do More in Less Time! An easy-to-understand guide to the more advanced features available in the Microsoft 365 version of Word. Enhance the quality of your documents and boost productivity in any field with this in-depth resource. Complete your Word-related tasks more efficiently as you unlock lesser-known tools and learn to quickly access the features you need. Check out Microsoft 365 Word For Professionals For Dummies today!
Adding a blank line before your table is easy, but Word's behavior as you attempt to make the insert can depend on where ...
Discover MoreNeed to jump from one end of a table row to another? Word provides a couple of handy shortcuts that can make this type of ...
Discover MoreWhen laying out a page, you often need to move objects around to get them into just the right position. Word allows you ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
2025-09-30 08:56:24
Barbie
I would imagine you can use "replace all" if you select a table first and search "Down" instead of "All"; just be sure to say No when asked if you want to continue searching the rest of the document.
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments