Changing Picture Number when cutting and pasting

D

DonFlak

I am using a macro to copy and paste an image from one workbook to
another. When I copy the image from Workbook A it is "Picture 1".
When I paste it into Workbook B is becomes the next image in
progression for example "Picture 1863" I need to have the macro
automatically recognize the new "Picture Number" so that I can utilize
positioning commands such as:

Sheet1.Shapes("Picture 1").Left = Range("H29").Center
Sheet1.Shapes("Picture 1").Top = Range("H29").Top

What can be utilized to to allow the new "Picture Number" to be
utilized in the positioning commands?

I might also point out this image copies and pastes in to 6 different
worksheets on the same workbook so each time the image pastes, it
takes on a new number. I need to be able to control the positioning
of each image.
 
J

JE McGimpsey

Use the technique I used in my reply to your other post, e.g.:

With Sheet1
With .Pictures(.Pictures.Count)
.Left = .Range("H29").Left
.Top = .Range("H29").Top
End With
End With

No need to know the name of the picture at all...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top