J
JBNewsGroup
Hi,
I am working with WORD2000 VBA.
I am stepping through each item in a "master" document and updating tables
in a second document. In the "master" document there is a number *1. The
table that is being updated has values like *1047A, *1064, *1077, etc.. The
goal is to find an exact match, or not, for *1. Executing the Find I hit
each table value that has a *1xxx. The following code is in a Function
procedure:
-- set up table range --
With SearchRange
.Forward = True
.MatchCase = True
.MatchWholeWord = True
.MatchWildCards = False
SearchComplete = False
Do
.Execute FindText:=SearchText
If .Found then
If (SearchText = actual cell text without terminators) Then
RowNo = row number found by Execute
SearchComplete = True
End If
Else
RowNo = 0
SearchComplete = True
End If
Loop Until SearchComplete
End With
--- other code ---
How do I perform an Exact Match? Is the Loop the only way to do it or am I
missing something?
I also tried using the Selection object but it seems that I have the same
problem.
Any help or suggestions is greatly appreciated. I would like to get rid of
the Loop if possible as the table data can change and there may be "tons" of
data that could have a hit (the "master" can also change).
Thanks in advance.
Jerry Bodoff
I am working with WORD2000 VBA.
I am stepping through each item in a "master" document and updating tables
in a second document. In the "master" document there is a number *1. The
table that is being updated has values like *1047A, *1064, *1077, etc.. The
goal is to find an exact match, or not, for *1. Executing the Find I hit
each table value that has a *1xxx. The following code is in a Function
procedure:
-- set up table range --
With SearchRange
.Forward = True
.MatchCase = True
.MatchWholeWord = True
.MatchWildCards = False
SearchComplete = False
Do
.Execute FindText:=SearchText
If .Found then
If (SearchText = actual cell text without terminators) Then
RowNo = row number found by Execute
SearchComplete = True
End If
Else
RowNo = 0
SearchComplete = True
End If
Loop Until SearchComplete
End With
--- other code ---
How do I perform an Exact Match? Is the Loop the only way to do it or am I
missing something?
I also tried using the Selection object but it seems that I have the same
problem.
Any help or suggestions is greatly appreciated. I would like to get rid of
the Loop if possible as the table data can change and there may be "tons" of
data that could have a hit (the "master" can also change).
Thanks in advance.
Jerry Bodoff