C
CROD
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â€. I’ve tried several iterations and feel I am close, yet have not got
the end result. Could you assist me please!
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â€. I’ve tried several iterations and feel I am close, yet have not got
the end result. Could you assist me please!