Hi All,
I am wondering if it is at all possible to fill 2 shapes with a picture based on a cell value, using vba.
I am currently using vba to display images based on another cell value and this is working fine. This uses the
My shape is called "Header" and "Header1"
My Cell that this will look at is I7.. This cell contains a drop down list with the selections of either "Music" or "Movies"
If this cell changes then I want shape Header to change its background image. same for Shape1.
I hope I have explained this enough for everyone to understand.
Any help greatly appreciated.
I am wondering if it is at all possible to fill 2 shapes with a picture based on a cell value, using vba.
I am currently using vba to display images based on another cell value and this is working fine. This uses the
Code:
Private Sub WorkSheet_Change(ByVal Target As Range)
Dim MyPict As Picture
Dim PictureLoc As String
Dim MyPict1 As Picture
Dim PictureLoc1 As String
If Target.Address = Range("M4").Address Then
ActiveSheet.Pictures.Delete
PictureLoc = "C:\Users\Greg\Documents\DVD Covers\" & Range("M4").Value & ".jpg"
With Range("B4")
Set MyPict = ActiveSheet.Pictures.Insert(PictureLoc)
'.RowHeight = MyPict.Height
MyPict.Top = .Top
MyPict.Left = .Left
MyPict.Width = 400
MyPict.Height = 350
MyPict.Placement = xlMoveAndSize
End With
End If
End Sub
My shape is called "Header" and "Header1"
My Cell that this will look at is I7.. This cell contains a drop down list with the selections of either "Music" or "Movies"
If this cell changes then I want shape Header to change its background image. same for Shape1.
I hope I have explained this enough for everyone to understand.
Any help greatly appreciated.