Unclechawie
New member
- Joined
- Jun 24, 2013
- Messages
- 5
- Reaction score
- 0
- Points
- 0
I'm working on an application that will add a picture based on a series of previous selections. The selection culminate in the name of the image I need in cell c67 of sheet "Info". It then pastes it at cell a15 of sheet "Setup" Here is the code for pulling in the picture.
What I'm having trouble with is a way to automatically change the name of the newly embedded picture so as to be able to manipulate it. My desire is that each time a dropdown selection is made from the dropdown menu in question, it will delete the previous photo and make the new one appear. The last selection is to be kept for later usage in the application. My first thought is just to code a macro to search every shape name until it finds the only one with "Picture" in the name. I'm not quite sure how to do that though. All thoughts and suggestions are much appreciated.
Charles
Code:
Filename = Filepath & info.Range("c67") & ".jpg"
With setup.Range("a15")
Set pic = setup.Shapes.AddPicture(Filename, msoFalse, msoTrue, .Left, .Top, 300, 240)
End With
What I'm having trouble with is a way to automatically change the name of the newly embedded picture so as to be able to manipulate it. My desire is that each time a dropdown selection is made from the dropdown menu in question, it will delete the previous photo and make the new one appear. The last selection is to be kept for later usage in the application. My first thought is just to code a macro to search every shape name until it finds the only one with "Picture" in the name. I'm not quite sure how to do that though. All thoughts and suggestions are much appreciated.
Charles