Forum Discussion
Gilgamesh1964
Feb 10, 2021Brass Contributor
Can I count the number of replaced texts in VBA
Hi,
I am changing all instances of text1 to text2 in my document in VBA.
The change itself is very easy
Set WordRange = ActiveDocument.Content
WordRange.Find.Execute FindText:="Text1", ReplaceWith:="Text2", Replace:=wdReplaceAll
But I want to know how many replacements were made.
Is there any way of finding this out?
Thanks
- Gilgamesh1964Brass Contributor