jeffreybrown
Well-known Member
- Joined
- Jul 28, 2004
- Messages
- 5,152
This code is working fine; however, can't seem to find how to get the picture to come from inside the workbook instead of a location on the computer?
I embedded the pictures within the workbook and the names are "Picture 3" and "Picture 4".
Also, realize you shouldn't use Select/Selection but can't seem to get away from it here.
Any thoughts?
I embedded the pictures within the workbook and the names are "Picture 3" and "Picture 4".
Also, realize you shouldn't use Select/Selection but can't seem to get away from it here.
Any thoughts?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rng As Range
Set Rng = Target.Parent.Range("A1")
If Target.Count > 1 Then Exit Sub
If Intersect(Target, Rng) Is Nothing Then Exit Sub
ActiveSheet.Shapes("Rec").Select
Select Case Target.Value
Case "Pic1"
Selection.ShapeRange.Fill.UserPicture "C:\Users\Jeff\Desktop\Pic1.png"
Case "Pic2"
Selection.ShapeRange.Fill.UserPicture "C:\Users\Jeff\Desktop\Pic2.png"
End Select
Application.Goto [A1]
End Sub