Forum Discussion

1 Reply

  • Jamil's avatar
    Jamil
    Bronze Contributor

    Shapes can be charts, callouts, diagrams many types of shapes exists.

     

    if you want to count particular one of them then you can use the code below and you can change the shp.type  on any of the below listed ShapeType Enumeration to count particular ones or exclude or include shape types.  if you remove the shape type then it will count anything that is classified as shapes in Excel

     

     

    Sub Test2()
        Dim shp As Shape
     
        For Each shp In Sheet1.Shapes
            If shp.Type = 1 Then
            Counter = shp.ID + 1
            End If
        Next
        MsgBox Counter - 2
    End Sub
    

     

Resources