anthonymedz
Board Regular
- Joined
- Jan 30, 2015
- Messages
- 69
Hi guys,
Can you help me on my project. I wanted to search the exact product and if does not match a message box error will appear. I have a script wherein when i search a product and when it was empty a message box will appear saying "Insert Product" then when i search a product with a wrong product or wrong spelling a message will appear "Wrong product" else if the Product is correct it will proceed on that Product sheet. I have a list of a Product in Range B7:B27. Thank you.
Private Sub CommandButton3_Click()
If TextBox1 = "" Then
MsgBox "Insert Product", vbCritical, "Product is blank"
'TextBox1.SetFocus
Exit Sub
ElseIf TextBox1 <> Range("B7:B27").Value Then
MsgBox "Wrong Product Description", vbCritical, "Product Description is wrong"
'TextBox1.SetFocus
Exit Sub
End If
Sheets(Me.TextBox1.Value).Visible = True
Sheets(Me.TextBox1.Value).Select
End sub
Can you help me on my project. I wanted to search the exact product and if does not match a message box error will appear. I have a script wherein when i search a product and when it was empty a message box will appear saying "Insert Product" then when i search a product with a wrong product or wrong spelling a message will appear "Wrong product" else if the Product is correct it will proceed on that Product sheet. I have a list of a Product in Range B7:B27. Thank you.
Private Sub CommandButton3_Click()
If TextBox1 = "" Then
MsgBox "Insert Product", vbCritical, "Product is blank"
'TextBox1.SetFocus
Exit Sub
ElseIf TextBox1 <> Range("B7:B27").Value Then
MsgBox "Wrong Product Description", vbCritical, "Product Description is wrong"
'TextBox1.SetFocus
Exit Sub
End If
Sheets(Me.TextBox1.Value).Visible = True
Sheets(Me.TextBox1.Value).Select
End sub