Hi
I have a code which I am trying to work with to show message box pop up on userform when search function does not return item from the sheet2 of the data. Below is a workable code that do the search and put the items in respective text boxes; When does not found any item it doesn't return anything and I would need to show pop up message that " Item not found".
Code
Private Sub CommandButton1_Click()
row_number = 0
Do
DoEvents
row_number = row_number + 1
item_in_review = Sheets("Sheet2").Range("B" & row_number)
If item_in_review = TextBox1.Text Then
TextBox2.Text = Sheets("Sheet2").Range("A" & row_number)
TextBox3.Text = Sheets("Sheet2").Range("B" & row_number)
TextBox4.Text = Sheets("Sheet2").Range("D" & row_number)
TextBox5.Text = Sheets("Sheet2").Range("E" & row_number)
TextBox6.Text = Sheets("Sheet2").Range("C" & row_number)
Loop Until item_in_review = ""
End Sub
Display More
Not sure what to do to show message box when I item not found in the data set.
Prompt help will be highly appreciated.
Thanks