Macro - replace with condition
Hi
I have the following code which replaces the .00 with blanks (nothing). In otherwords it removes .00 from the document.
But currently it is removing ".00" if it find anywhere such as .008 will change to 8.
I only want to change if ".00" is like 5.00. so only in this case it should remove ".00".
Sub find()
With Selection.find
.Text = ".00"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
'Selection.find.Execute replacewith:="" not required as the code is there.
Selection.find.Execute Replace:=wdReplaceAll
End Sub
|