Hi,
I'm trying to setup a userform that would display pictures pulled from my computer based on a look up value from a combox value. The combo box is Named "cboSKU", I'm encountering two issues with my code.
- I want the picture to auto update when i enter the combo box value, currently I have to click the image box to get the picture loaded.
- When the file is found it takes a very long time to load.
- If there isn't any picture found, I want it to just print "Picture Not Found" in the image box, but can't get it to work. My code now is setup to show an message box but that doesn't either work.
I can't attach a file due to sensitive information, However here is the code.
Private Sub Image1_Click()
Dim LosSKU As String
LosSKU = Worksheets("COSTS").Range("A:A").Find(cboSKU).Offset(0, 12)
pic = "C:\SKU IMAGES\" & (LosSKU) & ".jpg"
Image1.Picture = LoadPicture(pic)
If IsError(Image1.Picture) Then
MsgBox "No Picture Found"
Exit Sub
End If
End Sub
I'm a newbie to VBA, but a quick learner.
Thanks for any assistance.
Bookmarks