If Then VBA
I am trying to get the following VBA €śIF Then€ť script to run and am having
mixed results.
If a4 = No Then
MsgBox "No Match"
Exit Sub
Else
Supplier = InputBox("Modify Name or Code", "Company Update",
Range("F5:F5000").Find(TextBox1).Value)
Range("F5:F5000").Find(TextBox1).Value = Supplier
Range("V5:V5000").Find(TextBox1).Value = Supplier
End If
End Sub
Ideally, each time A4 = No, I want the the MsgBox to appear and the run to
stop; conversely each time cell A4=Ok, I want the script (lines below €śElse€ť)
to execute. €śA4€ť represents a cell which determines if there is a match in
an underlying database column (i.e. returns €śNo€ť if not & €śOK€ť if there is
in fact an exact match). Currently the first half of the script works, but,
does not execute beyond. If I remove the €śExit Sub€ť I have a €śRun Time
Error€ť. Ive tried several iterations and feel I am close, yet have not got
the end result. Could you assist me please!
|