Andreas Hermle
asked on
Delete certain graphic from all worksheets of the current workbook
Dear Experts:
below code is supposed to delete all shapes named "Arrow_75" from all worksheets of the currently active workbook.
Regrettably nothing happens. What is wrong with this code?
Help is much appreciated. Thank you very much in advance.
Regards, Andreas
below code is supposed to delete all shapes named "Arrow_75" from all worksheets of the currently active workbook.
Regrettably nothing happens. What is wrong with this code?
Help is much appreciated. Thank you very much in advance.
Regards, Andreas
Sub DeleteCertainShapes()
Dim shp As Shape, ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
For Each shp In ws.Shapes
If shp.Name Like "Arrow_75" Then
shp.Delete
End If
Next
Next
End Sub
Have you tried = instead of Like?
Please try...
If shp.Name Like "Arrow_75*" Then
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Pleased to help