Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR ASSEMBLY

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!"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #vba #check #shape #exists
ADD COMMENT
Topic
Name
6+8 =