I have a userform with two textboxes BPName2
and SPName2
. After the If found=true then exit for
statement in below code. I would like to move to the 2nd textbox. But, having trouble doing so. Anyone have an idea on how to do this?
Private Sub txt_BPName2_Exit(ByVal Cancel As ReturnBoolean)
Dim Row As Integer
Row = ActiveCell.Row
Dim c As Range
Dim found As Boolean
found = False
For Each c In Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row)
If c.Value = txt_BPName2 Then MsgBox "Cell " & c.Address & " Base Product Found."
If c.Value = txt_BPName2 Then found = True
If found = True Then Exit For
Next
If found = False Then
'Cells(Row, 1).Value = txt_BPName2.Text
MsgBox ("Base Product not found")
'ActiveCell.Offset(1, 0).Select
Add_Inventory_SP.Hide
End If
Cancel = True
End Sub