An implementation of Visual Basic that is built into Microsoft products.
Hi @SteveD,
This happens because Word’s Find method matches substrings by default, so searching for 3 also matches 13.
- To ensure Word finds only the exact numeral 3 (and not 13), you need to either:
- Match the whole word using wildcards, and
Move the search range forward after the first match so the second occurrence is found.
Below is a working VBA example that does exactly that.
VBA Example (Find second exact “3” only)
Sub FindSecondThree()
Dim rng As Range
Set rng = ActiveDocument.Range
With rng.Find
.ClearFormatting
.Text = "<[3]>" ' match only the standalone number 3
.MatchWildcards = True
.MatchWholeWord = False ' wildcard already ensures whole word
.MatchCase = False
.Forward = True
.Wrap = wdFindStop
End With
' Find first occurrence
If rng.Find.Execute Then
' Find second occurrence
If rng.Find.Execute Then
rng.Select ' this is the second standalone 3
End If
End If
End Sub
Furthermore, you can follow the steps below to find the standalone numeral 3.
1. Loop through all matches (more flexible VBA)
Instead of calling .Execute twice, you can loop and stop at the 2nd match. This is cleaner if later you want the 3rd, 4th, etc.
Sub FindNthThree()
Dim rng As Range
Dim count As Integer
Set rng = ActiveDocument.Range
count = 0
With rng.Find
.ClearFormatting
.Text = "<[3]>"
.MatchWildcards = True
.Forward = True
.Wrap = wdFindStop
End With
Do While rng.Find.Execute
count = count + 1
If count = 2 Then
rng.Select
Exit Do
End If
rng.Collapse wdCollapseEnd
Loop
End Sub
2. Use Word's “Find All” + index (manual or VBA hybrid)
You can collect all matches first, then pick the second. It's useful when you want to store or process multiple matches
Sub FindSecondViaCollection()
Dim rng As Range
Dim results As New Collection
Set rng = ActiveDocument.Range
With rng.Find
.Text = "<[3]>"
.MatchWildcards = True
.Forward = True
.Wrap = wdFindStop
End With
Do While rng.Find.Execute
results.Add rng.Duplicate
rng.Collapse wdCollapseEnd
Loop
If results.Count >= 2 Then
results(2).Select
End If
End Sub
3. Add-in / Tool options
If you prefer no coding or reusable tools, here are options:
Built-in Advanced Find (no add-in)
- Press Ctrl + H
- Enable Use wildcards
- Search: <[3]>
- Click Find In => Main Document
This highlights all matches, then just jump to the second one. Note: Please understand that my initial response does not always resolve the issue immediately. However, with your help and more detailed information, we can work together to find a solution.
I hope this information is useful. Additionally, as other users have raised similar concerns and may not be aware of where to share their feedback, I hope this response helps clarify the situation and suggests a potential next step. Highlighting this information can make it more visible to others in the community who may be facing the same issue, making it easier for them to find guidance and contribute their feedback as well.
Thank you again for your time and for raising this important usability concern. If you have any further questions or need additional assistance, please don’t hesitate to reach out.
I look forward to your thoughts on this.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.