So the VLOOKUP returns the name of the image file.
Do you have the path to the image file(s)
If you did you could use LoadPicture
Private Sub txtCode_Change()
Dim strImagePath
Dim Res As Variant
strImagePath = "C:\Documents\Images\" ' change path as required
Res = Application.VLookup(txtCode.Text, Sheets("PC_Laborer").Range("A1:E13"), 2, 1)
If Not IsError(Res) Then
txtEmp.Value = Res
End If
Res = Application.VLookup(txtCode.Text, Sheets("PC_Laborer").Range("A1:E13"), 4, 1)
If Not IsError(Res) Then
empLabel.Caption = Res
End If
Res = Application.VLookup(txtCode.Text, Sheets("PC_Laborer").Range("A1:E13"), 5, 1) ''' Something like this
If Not IsError(Res) Then
Image1.Picture = LoadPicture(strImagePath & Res)
End If
End Sub
Bookmarks