I've been searching and searching to find an answer for this and, while I've found many answers, none of them seem to be working for me. I'm trying to copy several rows and then paste them below. There is a specific area that will sometimes have pictures and/or shapes that I don't want to copy down to the newly created rows. So I'm trying to select the shapes within the newly created area and delete them.
Most of the code I've found so far seem to be some variation of this:
However, this code is giving me Run-time error '1004': Application-defined or object-defined error.
Weird thing is. I ran it once and it seemed to work, but if I delete the rows that were created and run the macro again, I continuously get the error above.
Most of the code I've found so far seem to be some variation of this:
Code:
Dim sh As Shape
For Each sh In ActiveSheet.Shapes
If Not Intersect(Range("B454:AA480"), sh.TopLeftCell) Is Nothing And _
Not Intersect(Range("B454:AA480"), sh.BottomRightCell) Is Nothing Then
sh.Delete
End If
Next sh
However, this code is giving me Run-time error '1004': Application-defined or object-defined error.
Weird thing is. I ran it once and it seemed to work, but if I delete the rows that were created and run the macro again, I continuously get the error above.