Hello rck3,
I have added the the Worksheet_Change macro to the attached workbook. The picture will be loaded, if it can be located, into an Image Control on the "Home" worksheet.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim PicPath As Variant
Dim Rng As Range
Dim RngEnd As Range
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Range("C2")) Is Nothing Then Exit Sub
With Worksheets("Home Data")
Set Rng = .Range("A2")
Set RngEnd = .Cells(Rows.Count, Rng.Column).End(xlUp)
If RngEnd.Row < Rng.Row Then Exit Sub
Set Rng = .Range(Rng, RngEnd)
End With
Application.EnableEvents = False
Set PicPath = Rng.Find(Target.Value, , xlValues, xlWhole, xlByRows, xlNext, False, False, False)
If PicPath Is Nothing Then
PicPath = ""
Else
PicPath = PicPath.Offset(0, 1).Value
End If
On Error Resume Next
ActiveSheet.OLEObjects("Image1").Object.Picture = LoadPicture(PicPath)
Application.EnableEvents = True
End Sub
Bookmarks