ooitzechyi
09-14-2016, 09:13 PM
hi,
How could I count no of specify shape in a group? (eg: I have 2 red color shapes in a group)
Tried with
Dim sh As Sheet1
Dim shp As Shape
Dim CountChildShapeRed As Long
For Each shp In Sheet1.Shapes
Select Case Shapes
Case Is = msoGroup
For x = 1 To Shapes.GroupItems.Count
If Sheet1.Shapes(x).HasChildShape Then
If Sheet1.Shapes.Child.Fill.ForeColor.RGB = RGB(255, 204, 255) Then CountChildShapeRed = CountChildShapeRed + 1
End If
Next
End Select
Next shp
Sheet1.Cells(4, 1) = CountChildShapeRed
The result I get is blank.
How could I count no of specify shape in a group? (eg: I have 2 red color shapes in a group)
Tried with
Dim sh As Sheet1
Dim shp As Shape
Dim CountChildShapeRed As Long
For Each shp In Sheet1.Shapes
Select Case Shapes
Case Is = msoGroup
For x = 1 To Shapes.GroupItems.Count
If Sheet1.Shapes(x).HasChildShape Then
If Sheet1.Shapes.Child.Fill.ForeColor.RGB = RGB(255, 204, 255) Then CountChildShapeRed = CountChildShapeRed + 1
End If
Next
End Select
Next shp
Sheet1.Cells(4, 1) = CountChildShapeRed
The result I get is blank.