Returning to Where You Were Before Finding Something

by Allen Wyatt
(last updated April 11, 2020)

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 Office 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

Printing a Style Sheet

Styles are a fantastic way to format your documents easily and consistently. At some point you may want to print out a ...

Discover More

Default Numbering Format for Endnotes

The default format for endnote numbers is lowercase Roman numerals. If you want the numbers to use a different format, ...

Discover More

Saving in Two Locations

When you save a workbook to disk, you may want to automatically save a duplicate workbook in a separate location. This ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (ribbon)

Viewing More of the Left Margin Area

When working in Draft or Normal view, you may want to view the area just to the left of the document's left margin. ...

Discover More

Inserting a Non-Breaking Hyphen

Non-breaking hyphens can come in helpful for some types of writing. They force the words (or characters) on both sides of ...

Discover More

Wrapping Spaces

Add more than one space after the end of a sentence, and you may find that the extra spaces wrap to the start of new ...

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}] 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 six more than 2?

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.

Newest Tips
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.