Answers for "vba check if shape name exists"

0

vba check if shape name exists

Function shapeExists(shapeName As String) As Boolean
'returns TRUE if a shape named [ShapeName] exists on the active worksheet
    Dim sh As Shape
    For Each sh In ActiveSheet.Shapes
         If sh.Name = shapeName Then shapeExists = True
    Next sh
End Function

'Example Usage
If Not shapeExists("My Shape Name") Then MsgBox "Shape not found!"
Posted by: Guest on November-25-2021

Code answers related to "vba check if shape name exists"

Code answers related to "Assembly"

Browse Popular Code Answers by Language