I am trying to count the number of shapes in a given range which has worked fine so far. The code throws an error if I run the code after activating a drop down menu in the sheet.
Dropping down the menu causes the sheet to "add" a shape called "Drop Down 13". My code does not like that and gives me the error "Application-defined or object-defined error"
Here is my code posted below:
Is there a way that I can ignore this drop down shape in my calculation and only check for Picture shapes? That's what I'm really after.
None of the typical On Error Resume Next or On Error GoTo's have worked for me so far because they defeat the purpose of what the code is trying to do. Count the pictures in the range.
Please let me know if you can help!
Dropping down the menu causes the sheet to "add" a shape called "Drop Down 13". My code does not like that and gives me the error "Application-defined or object-defined error"
Here is my code posted below:
Code:
Sub CheckForPrimaryPics()
Cnt = 0
For Each shp In ActiveSheet.Shapes
If Not Application.Intersect(Range("AC13:AQ32"), shp.TopLeftCell) Is Nothing Then Cnt = Cnt + 1
Next
Is there a way that I can ignore this drop down shape in my calculation and only check for Picture shapes? That's what I'm really after.
None of the typical On Error Resume Next or On Error GoTo's have worked for me so far because they defeat the purpose of what the code is trying to do. Count the pictures in the range.
Please let me know if you can help!