Word: Add something just before a table cell marker
July 7, 2011Did you know that you can add something (perhaps a missing period or a % symbol) just before each cell marker in a Word table? By default, there’s no easy way to find the cell markers using Word’s Find and Replace, but with a little trickery you can do it.
The critical thing that allows this to work is knowing the style used for the table cells. Word has to have something to find and as it can’t find a cell marker and as the text in each cell is different, there needs to be something it can hook on to — the style is what we get it to look for. Once Word’s got something to find, it can perform the replace action.
In the steps below, I take you through how to add a period to the end of each selected cell in a table (substitute your own character(s) for the period if you want something different). This technique works in Word 2003 and later.
- Locate the table where you want to add the period to the end of each cell.
- Check the style used for the cells (e.g. Table Cell). The style should be the same for each cell where you want to make the change. If it’s not the same, make it the same — you can always change it back later.
- Select the cells you want to change. Don’t worry about what text is in the cells — it will all still be there after you do the Find/Replace.
- Press Ctrl+H to open the Find and Replace dialog box. The cursor is in the Find what field — DO NOT type anything in here!
- Click the More button.
- Click the Format button and select Style from the list.
- In the Find Style dialog box, type the first letter of the style’s name (e.g. t for Table Cell) to jump to that section in the list. Scroll to find the style’s name (e.g. Table Cell), select it, then click OK. The style name is listed below the Find What field.
- Move your cursor into the Replace with field.
- Type ^&. (that’s the caret character [Shift+6], followed immediately by the ampersand [Shift+7], followed immediately by a period — the character you’re adding in this exercise).
- Click Replace All.
And you’re done!
By the way, the ^& part of the replace string means replace the same text with what you already had.
See also:
- http://help.wugnet.com/office/End-cell-character-searching-replacing-table-ftopict1104324.html
- http://help.wugnet.com/office/Find-Replace-character-end-cell-mark-ftopict1146159.html
- http://support.microsoft.com/kb/165928
- For a macro to remove spaces at the end of table cells, see: http://americaneditor.wordpress.com/2014/05/05/lyonizing-word-removing-spaces-at-the-ends-of-table-cells/ (WARNING: USE WITH CARE: My experience is that this macro removes ALL character formatting in the cells where it deletes the ending space—highlighting, hyperlinks, italics, bold, superscripts, subscripts, as well as bookmarks. For a quicker and less intrusive option for getting rid of the spaces at the end of a cell, change the alignment of the cells, then change back again; e.g. set the cells to centre-aligned, then back to left-aligned.)
[Links last checked May 2014; thanks to my friend Char who asked the question and sent me on the chase to find out the answer]
You are AWESOME! This totally saved my life replacing text in the same paragraph style but seperated by a line break. There was font change for text preceding and then another for text proceeding the line break. Perfect!
by Christina Garcia February 2, 2013 at 9:27 amthank you ! but I cannot do it in my Word 2010, I tried to find “Table cell” in my style list many times, but I couldn’t!!!, the name “Table cell” has been changed into anything else??? I use Word 2010, not Word 2003!
please tell me how ! thank you again!
by johnc March 15, 2013 at 10:46 amHi Johnc
There is NO ‘Table cell’ style by default — that is just an example. The instructions at Step 2 say: “Check the style used for the cells (e.g. Table Cell). The style should be the same for each cell where you want to make the change. If it’s not the same, make it the same — you can always change it back later.” So you need to check what style is used for the table cells; if various styles are used, then change them all to the same style (at this stage it’s irrelevant what that is, as long as it’s the same), then continue with the steps, changing back to the original styles used in the table cells once you’re done.
As far as I am aware this works just as well in Word 2007, 2010, and presumably 2013.
–Rhonda
by Rhonda March 15, 2013 at 10:51 amOutstanding!
I was able to use this tip to delete trailing spaces at the end of cells. I just followed the instructions to add an unusual character (I used the pipe (|) symbol) at the end of each cell, and then used search/replace to delete all instances of | and | alone (for cells that had no trailing space to start with).
Worked like a charm. I’ll remember this one.
by ydforums June 4, 2013 at 4:47 pmThank you! This is great!
by Marijke Singer March 10, 2015 at 4:50 amThis is clever.
I’m trying to do something a bit different. I’ve got some tables imported from a PDF document, and a bunch of the cells have trailing spaces at the end. To delete them I’d search for a space followed by the cell marker, but since it’s not possible to search for the cell marker, I’m stymied.
I suppose I could write a macro to check the contents of each cell and if the last character is a space, then delete it.
Can you think of a better way?
Thanks
by yossiswinepage March 12, 2015 at 12:52 amHi yossiswinepage
Check the comment from ydforums (4 June 2013) for a possible solution. They did it in two steps, replacing the space with a character unlikely to be used in the document, then replaced that character with nothing.
–Rhonda
by Rhonda March 12, 2015 at 10:50 amWhat I’m seeing – and I think what johnc is saying – is that when I put the cursor in a table cell the style for it (in Word 2003) is “Table Grid”. When I follow your steps, in the find style dialog box there is NO “Table Grid”. (Table Grid appears to be the default style for table cells; I have not applied any formatting to the table nor to the text within it.)
I am trying to do this with a document that has many one-cell tables, so in addition to needing something that works in the first place, I need a global search and replace throughout the whole document.
by sparkles December 27, 2015 at 8:54 pmHi Sparkles
You’ll likely have to create a new style and apply it to the cells, then run the procedure above.
–Rhonda
by Rhonda December 28, 2015 at 6:38 amTo: yossiswinepage
by Nasrullah April 7, 2016 at 5:01 pmThe most simplest way to replace trailing spaces of the text copied either from PDF or any website. Select that space, cut it (Ctrl+X), then press undo.
Press Ctrl+H. In the find portion put your cursor and press Ctrl+V. In the replace portion, put your cursor and press space bar (to add a single space). Press Replace all, check the magic.
Does this apply to WORD 2013?
by Mike Rothschild May 26, 2016 at 2:23 amHi Mike
I assume it will, though I haven’t tested it in Word 2013.
–Rhonda
by Rhonda May 26, 2016 at 8:32 amWorks in 2016, too.
by Perrorist October 31, 2016 at 11:56 amStill doesn’t work.
I created a new style and applied it to the cells, as you suggested. This style does not appear in the Format – Style list. (In fact, several of the styles applied in the document do not appear in this list, and some that do appear are not used in the document.)
by sparkles November 30, 2016 at 11:41 pmHi Sparkles
The Format > Style list seems to be ordered based on the ‘Assigned Value’ of the style. You can find a style’s assigned value on the Manage Styles dialog box under the Recommend tab. To get to this box, click the tiny arrow in the bottom right corner of the Styles group on the Home tab — this opens the Styles panel. Then click the bottom right icon (‘Manage Styles’) in that panel to open the Manage Styles dialog box. Go to the Recommend tab, change the sort order to Alphabetical and see if you can see your new style listed. Assuming you can, check the number to its left in the list — that number seems to dictate the order of the Styles list under Format > Style. To change that number, click Assign Value and enter a new number (e.g. 1 for anything you want to see at the top of the Format > Style list). You don’t have to change the number — the most important thing is to confirm your new style is actually listed. Assuming it is, then you may find you have to scroll the Format > Style list to see it. NOTE: The Format > Style list only shows character and paragraph styles, which may be why you’re not seeing all the styles.
by Rhonda December 1, 2016 at 6:18 amAWESOME TRICK! Thanks!
by davidg2p February 23, 2019 at 7:59 am[…] Google search brought me to this tip on how to add something to the end of a table cell (I planned to add something like "§§§" to each cell and then do a simple search/replace for " […]
by Remove trailing whitespace at the end of table cells - Boot Panic October 29, 2021 at 11:02 pm