I am trying to pull in an image when a specific word is selected from a drop down. I have been able to successfully use the code below to pull in images from a folder for one dropdown. However, I have multiple dropdown lists(Located at B7, E7, H7, K7, N7, B12, E12, & H12) that need to be able to pull in an image in the cell below. How can I modify the code to pull in different images across multiple dropdowns?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myPict As Picture
Dim PictureLoc As String
If Target.Address = Range("B7").Address Then
ActiveSheet.Pictures.Delete
PictureLoc = "C:\Users\sl\Desktop\IMAGES\" & Range("B7").Value & ".png"
With Range("B9")
Set myPict = ActiveSheet.Pictures.Insert(PictureLoc)
.RowHeight = myPict.Height
myPict.Top = .Top
myPict.Left = .Left
myPict.Placement = xlMoveAndSize
End With
End If
End Sub
Bookmarks