Written by Allen Wyatt (last updated April 11, 2020)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365
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:
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.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
Want to protect certain paragraphs in your document so they cannot be changed? This tip provides a look at three ...
Discover MoreSometimes you may see characters in a document that you cannot get rid of and you aren't sure what they are. That's the ...
Discover MoreNeed to know how many lines are in your document? Word provides a quick and easy way you can determine the information.
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
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
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 © 2023 Sharon Parq Associates, Inc.
Comments