選択中のスライドを対象に以下の操作を実行します。
選択中のオートシェイプと同じ色のシェイプを一括選択。
Sub SelectSameColor()
Dim myShape As Shape
Dim ShapesCount As Integer
Dim ArrayIndex As Integer
ShapesCount = ActiveWindow.Selection.SlideRange.Shapes.Count
ArrayIndex = 0
ReDim ShapesArray(1 To ShapesCount)
For i = 1 To ShapesCount
If ActiveWindow.Selection.SlideRange.Shapes.Item(i).Fill.ForeColor = ActiveWindow.Selection.ShapeRange.Fill.ForeColor Then
ArrayIndex = ArrayIndex + 1
ShapesArray(ArrayIndex) = ActiveWindow.Selection.SlideRange.Shapes.Item(i).Name
End If
Next
ActiveWindow.Selection.SlideRange.Shapes.Range(ShapesArray).Select
End Sub
選択中のオートシェイプと同じ色で同じ形状のシェイプを一括選択。
Sub SelectSameColorAndType()
Dim myShape As Shape
Dim ShapesCount As Integer
Dim ArrayIndex As Integer
ShapesCount = ActiveWindow.Selection.SlideRange.Shapes.Count
ArrayIndex = 0
ReDim ShapesArray(1 To ShapesCount)
For i = 1 To ShapesCount
If ActiveWindow.Selection.SlideRange.Shapes.Item(i).Fill.ForeColor = ActiveWindow.Selection.ShapeRange.Fill.ForeColor _
And ActiveWindow.Selection.SlideRange.Shapes.Item(i).AutoShapeType = ActiveWindow.Selection.ShapeRange.AutoShapeType Then
ArrayIndex = ArrayIndex + 1
ShapesArray(ArrayIndex) = ActiveWindow.Selection.SlideRange.Shapes.Item(i).Name
End If
Next
ActiveWindow.Selection.SlideRange.Shapes.Range(ShapesArray).Select
End Sub
ありがとうございます。これは大変便利です!
ラインの場合でも使えるように、ラインまたは枠の色が同じものだけについて選択するものもいただけると助かります。