Returning to Where You Were Before Finding Something

Written by Allen Wyatt (last updated April 11, 2020)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


5

Karsten can use the Find and Replace capabilities of Word to find information easily in his document. However, when he is done using the tool and dismisses the Find and Replace dialog box, he would like to jump back to where he was when he first displayed the dialog box. Karsten wonders if there is a way to return to where he was before he changed his position using Find and Replace.

There are a few ways you can approach this. The first is to remember that you can use Shift+F5 to step back through your last three edit locations in the document. Pressing Shift+F5 once takes you to the last edit location, pressing it again returns you to the location before that, and so on.

This approach works well, provided you don't make more than three edits while the Find and Replace dialog box is open. If you do, then you may want to consider an old "brute force" method I often employ—just type some characters at the location you want to return to. For instance, I normally type "XXX", though any non-typical character set will work fine. When you are doing using Find and Replace, just do a quick search for XXX and you are back to the location you started.

Similar to this is the idea of adding a bookmark just before you do the Find and Replace. Pressing Ctrl+Shift+F5 displays the Bookmark dialog box. Type the bookmark name, close the dialog box, and use Find and Replace to do your edits. When done, press F5 to display the Go To tab of the Find and Replace dialog box, then you can use the controls there to return to the location of your bookmark.

There's a unique way you can automate this process, if you want, by using a macro. Consider the following short macro:

Sub ReturnLater()
    ActiveDocument.Bookmarks.Add Name:="ZXZX"
    Dialogs(wdDialogEditReplace).Display
    ActiveDocument.Bookmarks("ZXZX").Select
    ActiveDocument.Bookmarks("ZXZX").Delete
End Sub

The macro places a bookmark ("ZXZX") at the current location and displays the Find and Replace dialog box. When the Find and Replace dialog box is closed, then the display jumps back to the bookmark at the original position and, finally, the bookmark is deleted. This works because the Find and Replace dialog box is modal, which means you must exit it before the macro continues running.

When using the macro, there is one behavioral difference between the Find and Replace dialog box and the one you invoke when you press Ctrl+H. You cannot "click out" of the Find and Replace dialog box to make document edits while the dialog box is still visible.

Finally, there is one other approach that you might consider. You could simply open a second window on the document and then do the finding and replacing (and editing) in that second window. When you are done editing in the second window, close it and the insertion point in the original window remains where it was before you opened the second window.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (9235) 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

Picking a Group of Cells

Excel makes it easy to select a group of contiguous cells. However, it also makes it easy to select non-contiguous groups ...

Discover More

Capitalizing Spring

According to the normal rules of grammar, the word "spring" is not supposed to be capitalized. There may be times, ...

Discover More

Creating a Log/Log Chart

If you need to create a chart that uses logarithmic values on both axes, it can be confusing how to get what you want. ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (ribbon)

Differences between Deleting, Clearing, and Cutting

When getting rid of text from your document, Word allows you to delete, clear, or cut. Here are the differences between ...

Discover More

Understanding Hyphens and Dashes

Word provides you with three types of hyphens and two types of dashes that you can use in your documents. Understanding ...

Discover More

Capitalizing the First Letter after a Colon

There are many rules in English grammar (and many exceptions to those rules.) One common rule of grammar is to capitalize ...

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 2 + 8?

2020-04-13 09:53:32

Andrew

With regard to "When using the macro, there is one behavioral difference between the Find and Replace dialog box and the one you invoke when you press Ctrl+H. You cannot "click out" of the Find and Replace dialog box to make document edits while the dialog box is still visible":

I've also had the desire to invoke the Find dialog non-modally in my own macros. The only solution I could figure out was to invoke the Find dialog by calling « SendKeys "^h" » instead of relying on Dialogs(wdDialogEditReplace).

Andy.


2020-04-12 06:59:04

Simao Campos

Another approach is to save the current position and then come back to it after doing what you have to do. It assumes you are doing it via macro.

...
' Save current cursor position & go to top of document - line and column
Set currentPosition = Selection.Range
...
' Do what has to be done...
...
' Go back to original cursor position
currentPosition.Select

Cheers!


2020-04-11 11:46:35

Bill Darnall

Another approach to returning to your original location --- after searching and replacing --- is to use Word's split-screen feature. You can make as many changes as you wish in the "bottom" document partition. Later, when you remove the split, you will be back to the original location.


2020-04-11 08:22:08

Eric

I would recommend using the add-on for Word called TransTools. It is designed for translators, but it has several useful general functions as well, one of which is the ability to quickly set up to two TT-specific bookmarks on the document. That's what I use to go back to stuff once I'm done with find and replace.


2020-04-11 04:54:48

Arnold Fisher

I've been using the "xxx" marker for quite a while. To speed things up, I had my tech buddy create a macro to find "xxx" and added it to my quick access toolbar.

Sub Find()
'
' Find Macro
'
'
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
.Text = "xxx"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute
End Sub


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.