Hi All,
Why my msgbox is not appearing when a certain product is not found? Is there something missing with the code? Kindly assist.
thanks,
splucena
Why my msgbox is not appearing when a certain product is not found? Is there something missing with the code? Kindly assist.
Code:
Private Sub ComboBox1_Change()
Dim ProdFound As Range
With Worksheets("1L").Range("A:A")
Set ProdFound = .Find(ComboBox1.Value)
If ProdFound Is Nothing Then
MsgBox ("ITEM NOT FOUND!")
ComboBox1.Value = ""
Exit Sub
Else
With Range(ProdFound.Address)
Label2 = .Offset(0, 1)
Label3 = .Offset(0, 2)
Label4 = .Offset(0, 3)
Label5 = .Offset(0, 4)
Label6 = .Offset(0, 5)
Label7 = .Offset(0, 6)
Label8 = .Offset(0, 7)
Label9 = .Offset(0, 8)
Label10 = .Offset(0, 9)
Label11 = .Offset(0, 10)
Label12 = .Offset(0, 11)
Label13 = .Offset(0, 12)
Label40 = .Offset(0, 15)
'Label14 = .Offset(0, 13)
'Label15 = .Offset(0, 14)
'Label16 = .Offset(0, 15)
'Label17 = .Offset(0, 16)
On Error Resume Next
Image1.Picture = LoadPicture _
("C:\Documents and Settings\NOEL\Desktop\PHOTO2\" & ProdFound & ".jpg")
On Error GoTo 0
End With
End If
End With
thanks,
splucena