シート上のシェイプの色をまとめて黒に戻す例 [#d19b3958]
Sub Macro1()
Dim i As Integer
Dim acs As Worksheet
Set acs = ActiveSheet
For i = 1 To acs.Shapes.Count
Dim shap As Shape
Set shap = acs.Shapes(i)
With shap
acs.Activate
shap.Select
DoEvents
If (shap.Type = msoAutoShape) Then
If shap.AutoShapeType = msoShapeMixed Then
'コンピュータ図とか
ElseIf shap.AutoShapeType = msoShapeRoundedRectangle Then
'角の丸い四角
Selection.Font.ColorIndex = xlAutomatic
End If
ElseIf shap.Type = msoLine Then
Selection.ShapeRange.Line.ForeColor.SchemeColor = 64
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
ElseIf shap.Type = msoTextBox Then
Selection.Font.ColorIndex = xlAutomatic
End If
End With
Next
End Sub