Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,570
- Office Version
- 365
- 2016
- Platform
- Windows
I have a worksheet with 4 macro embedded shapes on it. I'm am trying to get code to work that will delete two of the 4, but I'm not having any luck.
The loop is not finding any shapes named Group12 or Group3. I'm not entirely sure how to find their names. Their macro names are "'18-19 Materials Track.xlsm'!SRF_Group12_Click" and "'18-19 Materials Track.xlsm'!Group5_Click" respectively.
Code:
Dim Shp as Shape
With wb2.Worksheets(1)
.Unprotect
For Each Shp In ActiveSheet.Shapes
If Shp.Name = "Group12" Then Shp.Delete
If Shp.Name = "Group3" Then Shp.Delete
Next Shp
.Protect
End With
The loop is not finding any shapes named Group12 or Group3. I'm not entirely sure how to find their names. Their macro names are "'18-19 Materials Track.xlsm'!SRF_Group12_Click" and "'18-19 Materials Track.xlsm'!Group5_Click" respectively.