shp.AutoShapeType = msoShapeRoundedRectangle '角丸
Dim fromshp as Shape set fromshp = sht.Shapes.AddShape(msoShapeRectangle, left1, top2, boxW, boxH) Dim toshp as Shape set toshp = sht.Shapes.AddShape(msoShapeRectangle, left2, top2, boxW, boxH) 'コネクタ生成 Dim con As Shape Set con = sht.Shapes.AddConnector(conType, 0, 0, 0, 0) '矢印 con.Line.EndArrowheadStyle = msoArrowheadTriangle '黒線にする con.Line.ForeColor.RGB = RGB(0, 0, 0) ' from con.ConnectorFormat.BeginConnect fromshp, 4 ' to con.ConnectorFormat.EndConnect toshp, 2
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 SubSelection.ShapeRange.ZOrder msoSendToBack '最背面に移動