• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Count shapes in range

rolo

Member
Hello, I need some simple macro to count the number of shapes in a giving range...

Can you help me?

Thanks!
 
Here's a function (UDF) that will do it. You could then call if like

=CountShapes(A:C)

Code:
Function CountShapes(rngSearch As Range) As Long
    Dim sh As Shape
   
    For Each sh In rngSearch.Parent.Shapes
        If Not Intersect(rngSearch, sh.TopLeftCell) Is Nothing Then
            CountShapes = CountShapes + 1
        End If
    Next sh

End Function
 
Back
Top