I have a rather complex workbook that was given to me, and the VBA coding is way over my head. The code shown below is called on when a button is clicked on the worksheet to clear all calculations and their related shapes. I have added a couple more rectangle shapes and assigned my own macros to them. When this routine runs, it deletes the shapes I've added along with the ones it is supposed to.
I need to modify this routine so that the shapes I've added can be passed over the delete action. Had a couple of ideas that failed to work, but it's probably simpler that I think. The Shape Type = is probably one way of doing this but shapes and VBA are all new to me.
Some assistance would be greatly appreciated.
![]()
Sub ShapesDelete() Dim MyShape As Shape, i& For Each MyShape In ActiveSheet.Shapes i = i + 2 If i > 14 And MyShape.Type = 1 Then MyShape.Delete End If ' If MyShape.name = "Rounded Rectangle 63" Then ' ' End If Next MyShape End Sub
Bookmarks