#1
|
|||
|
|||
Search and goto
Hello colleagues, Was wondering If I could get some Help. I would like to create a search Macro for word 2016. What I have is a document I've created a text box and a Search button. Now I'd like to create code so that when I type a search word in the text box and press the search button the Macro then search the word document and go the that location. Any help would be greatly appreciated.
Thank you all very much. |
#2
|
||||
|
||||
You could have recorded that, however call the macro below with the value from your text box.
Code:
Sub FindWord(sWord As String) With Selection.Find .ClearFormatting .Replacement.ClearFormatting .Text = sWord .Execute End With End Su
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
GoTo Cell Reference in wdTable | Hdata | Word VBA | 6 | 02-10-2017 05:34 AM |
Application.GoTo a Range in another Window | sgbooth | Excel Programming | 1 | 11-21-2015 12:19 PM |
Inserting a contents with a "GOTO" | jrmourning | Word | 1 | 11-21-2014 07:03 AM |
Search for date and then apply mutliple search criteria in huge dataset | maxtymo | Excel | 2 | 12-01-2013 04:52 AM |
Word GoTo From Excel | mata30s | Word VBA | 14 | 12-10-2012 09:36 AM |