C
Chris
Hi Guys
I've written this code:
Sub CheckVal()
'
'CheckVal Macro written by Chris 25 October 2004 '
'Checks the value of the current balance
ActiveDocument.Tables(2).Cell(6, 4).Select
Selection.Find.ClearFormatting
With Selection.Find
.Text = "$*0.00"
.Forward = True
.Wrap = wdFindStop
.MatchWildcards = True
End With
Selection.Find.Execute
If Selection.Find = True Then
Exit Sub
Else
Application.Run macroname:="formatit"
End If
End Sub
The "Exit Sub" bit can be a skip to another macro, as long as the "Then"
works. At the moment, it keeps skipping to the "Else" if I have the If set
to True - which seems to be the opposite of what should happen as the Find
event highlights exactly what it is supposed to. What will normally appear
in the selection is "$ 0.00" (extracted from an Access Database by
someone else's macro). I know it finds the cell value, but I can't figure
why it skips the "Then".
I've written this code:
Sub CheckVal()
'
'CheckVal Macro written by Chris 25 October 2004 '
'Checks the value of the current balance
ActiveDocument.Tables(2).Cell(6, 4).Select
Selection.Find.ClearFormatting
With Selection.Find
.Text = "$*0.00"
.Forward = True
.Wrap = wdFindStop
.MatchWildcards = True
End With
Selection.Find.Execute
If Selection.Find = True Then
Exit Sub
Else
Application.Run macroname:="formatit"
End If
End Sub
The "Exit Sub" bit can be a skip to another macro, as long as the "Then"
works. At the moment, it keeps skipping to the "Else" if I have the If set
to True - which seems to be the opposite of what should happen as the Find
event highlights exactly what it is supposed to. What will normally appear
in the selection is "$ 0.00" (extracted from an Access Database by
someone else's macro). I know it finds the cell value, but I can't figure
why it skips the "Then".