View Single Post
  #4   Report Post  
Posted to microsoft.public.word.newusers
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 171
Default Help with wildcard search, please?

I think the closet you can get would be finding 60-89.
App A, Item No. [6-8][0-9][!0-9]

I assumed you wouldn't want to find part of:
App A, Item No. 627

Try:

Sub ScratchMacro()
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "App A, Item No. [6-8][0-9][!0-9]"
.MatchWildcards = True
While .Execute
If CLng(Mid(oRng, 17, 2)) 90 Then
MsgBox oRng.Text
End If
Wend
End With
End Sub


Ed wrote:
I'm trying to use Find (Ctrl+F) with wildcards to find a certain string
ending in a number between 60 and 81. I tried
(App A, Item No. )([60-81]{2})
but it found "App A, Item No. 10". I looked on the Word FAQ page for
Wildcards, but couldn't find how to restrict the number to "more than this
but less than that".

Can this be done with Find, or do I need to go into VBA?

Ed