Reputation: 1104
I've searched through out Google and on here for a proper answer and I can't seem to find one...
I have an image on "Sheet2" that I want to copy over to "Sheet1", the image's name is static and doesn't change. I've got the below code to delete the already existing image on "Sheet1" and now I need it to be replaced with the image from "Sheet2"
Sub CheckImageName()
For Each shape In ActiveSheet.Shapes
If Not Intersect(shape.TopLeftCell, Range("L77:AM97")) Is Nothing Then
shape.Delete
End If
Next shape
End Sub
Every method I saw was using .Select
and pasting into the area, however I'm really trying to avoid using the .Select
and .Paste
methods as I've read all over SO and other sources that it's best to avoid using .Select
.
Upvotes: 0
Views: 93
Reputation:
I found a response for Word that could apply for your question.
Sub createShape()
Set myshape = ActiveDocument.Shapes.AddShape(msoShapeRectangle, 100, 100, 100, 100)
Set anothershape = myshape.Duplicate
End Sub
Upvotes: 1