Finding Text at the End of a Table Cell

Written by Allen Wyatt (last updated September 5, 2023)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


2

When Peter wants to find a word at the end of a paragraph, he searches for XXX^p and replaces it with YYY^p. This doesn't, however, find words at the very end of table cells. He wonders how he can search and replace the words at the end of table cells and if there is a special code similar to ^p.

There is no special code similar to ^p (end of paragraph) to indicate the end of a cell. There is a trick you can try, however, that works well for many people.

First, create a unique paragraph style that you will use only for the contents of the cells in your table. Make sure you apply this style to all of the cells within the table. Next, use Find and Replace to search for the style. In the Replace With box, enter the code ^& followed by what you want to add to the end of the cell. Then, step through all occurrences and do your replacements, as desired. The ^& code specifies that you want to replace what you found (the text in the cells formatted with the unique style) with what you actually found.

If you want to replace a specific word in the table cells (XXX) with something new (YYY), you can follow the same steps as above, simply search for any occurrences of XXX using the unique table-cell style and replace it with YYY. You'll still want to step through the matches and determine if the replacement should be made on a case-by-case basis, but you will be able to make the changes in your table much quicker.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13571) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Absolutely Getting Rid of Formatting

Need to get rid of the formatting applied to a bunch of text? One of the easiest ways to do this is to use Notepad in ...

Discover More

Getting Rid of Wizards and Templates

Templates and wizards are used rather extensively in Word to either process a document or define how that document is to ...

Discover More

Conditional Formats that Distinguish Blanks and Zeroes

Conditional formatting is a great tool. You may need to use this tool to tell the difference between cells that are empty ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (ribbon)

Seeing the Height of a Row

Want to see the exact height of a row? This tip provides a quick and precise way that you can see that height.

Discover More

Jumping to a Table Row

Need to jump to a particular row in a table? Word provides an easy way to jump to all sorts of things, but it doesn't ...

Discover More

Preventing a Frame when Converting a Table to Text

Tables, in Word, can either be inline with the rest of your text or the text can wrap around the table. If you have ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is one less than 9?

2022-03-14 10:35:17

Andrew

Krasimir,

Just a thought: Sometimes in situations such as this it may be easier to blow out (delete) all of the problematical characters (in your case the "г") and then reinsert them where necessary using find and replace or a macro.

Another trick is to use a sequence of find and replace operations starting with, for example, replacing all "г " with "г^pX#$%" - i.e., the "г" followed by "semaphore" text beginning with the ^p followed by some other text will not appear anywhere else in the document. Then run your macro knowing that all occurrence of "г" will have a paragraph marker after it. Finally, delete the semaphore text "^pX#$%" you previously added with a find and replace operation.

Andy.


2022-03-12 16:47:09

Krasimir Paskulov

Hello,
Thank you very much for this useful idea.
I've been trying to solve a similar problem for quite a while now, and I still haven't manage to find a solution.
It think it goes the opposite way, but I'm not the wise one here, so I'm asking you if this trick could be used to solve my problem.
Here's my case:
I'm from Bulgaria, and for some strange reason, there's a habit of putting г. (abbreviation for year) at the end of dates. I'm a translator and it hampers my work immensely. So I scratched my head for a solution to this nasty г. and here's what I fixed up:
First remove all useless multiple spaces (^w -> one space), and replace all г. ^p with г.^p
Then turn on Use wildcards and go through 3 steps, to remove all variants of г. in all possible positions.
Step 1:
([0-9])г. ([!А-Я])
([0-9]) г. ([!А-Я])
([0-9]) г.([!А-Я ^13])
\1 \2

Step 2:
([0-9])г. ([А-Я])
([0-9]) г. ([А-Я])
([0-9]) г.([А-Я])
\1. \2

([0-9])г.(^13)
([0-9]) г.(^13)
\1.\2

And I thought I'd made it, only I found out г. remained intact at the end of lines in table cells.

So do you think there's a way for me to use the style application trick AFTER I have performed those 3 steps?
Or should I rather first select all tables, use this special style all through the table content, then look for all cases of г. in this style only, remove them, then restore the tables' normal style?

Thank you very much.

Best regards,
Krasimir Paskulov


This Site

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.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.