![]() ![]() Text & " was not found in the document/selection." Selection.MoveRight Unit:=wdCharacter, Count:=1 Replacement.Text = InputBox("Enter the replacement text:") Text = InputBox("Enter the text you want to find:") You can then use the value or convert the value to a string to display it. In the following example, the number of times will end up in the variable Replacements. Then use a variable in your macro to count the number of times the desired text gets replaced, and increment the variable every time a replacement occurs. Unfortunately there is no way to do this with a simple command or two instead you need to "step through" a document using the Find and Replace feature of Word.įirst, make a temporary copy of your document so that you don't run the risk of messing up your original document. ![]() Marc is looking for the fastest, most efficient way-within a macro-to determine a count of how many times a particular text string occurs within a document. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |