Hi Guys,
I have found this code (in search for an answer to my project-inserting an image if you have 2 list source ) from the book "EXCEL 2007 VBA & MACROS by Bill Jelen and Tracy Syrstad" and modified it to suite my project but I cannot make the image appear and so is the textbox to capture the data from the cell. What could have been wrong? I stayed late last night trying to figure out what could be wrong but my still learning brain almost explode last night with no right code in place. I need your expertise guys so I can close off this almost a month pending project of mine........Thanks for your help......!!!!!!!
I have found this code (in search for an answer to my project-inserting an image if you have 2 list source ) from the book "EXCEL 2007 VBA & MACROS by Bill Jelen and Tracy Syrstad" and modified it to suite my project but I cannot make the image appear and so is the textbox to capture the data from the cell. What could have been wrong? I stayed late last night trying to figure out what could be wrong but my still learning brain almost explode last night with no right code in place. I need your expertise guys so I can close off this almost a month pending project of mine........Thanks for your help......!!!!!!!
Code:
Private Sub cb_product_Change()
Dim ProdFound As Range
With Range("A1")
Set ProdFound = .Find(cb_product.Value)
If ProdFound Is Nothing Then
MsgBox ("Product not found!")
cb_product.Value = ""
Exit Sub
Else
With Range(ProdFound.Address)
tb_prodcode = .Offset(0, 1)
tb_prodname = .Offset(0, 2)
On Error Resume Next
Img_product.Picture = LoadPicture _
("C:\Documents and Settings\NOEL\Desktop\PHOTO\" & ProdFound & ".jpg")
On Error GoTo 0
End With
End If
End With
End Sub