回答編集履歴
2
▲対応版
answer
CHANGED
@@ -48,4 +48,58 @@
|
|
48
48
|
```
|
49
49
|
実行結果を載せておきます。
|
50
50
|
シートの枠線は非表示にしています。
|
51
|
-

|
51
|
+

|
52
|
+
|
53
|
+
---
|
54
|
+
ご要望のあった▲に対応したものを作ってみました。
|
55
|
+
▲の書き方が適当(というか作りっぱなし)なのでたぶん正三角形にはなってないです。
|
56
|
+
なので相変わらずずれてますが、ご勘弁ください。
|
57
|
+
```VBA
|
58
|
+
Sub test()
|
59
|
+
Dim x As Long
|
60
|
+
Dim y As Long
|
61
|
+
Dim l As Long
|
62
|
+
|
63
|
+
l = 60
|
64
|
+
|
65
|
+
x = 100
|
66
|
+
y = 100
|
67
|
+
Call threeline(x, y, l)
|
68
|
+
Call threeline(x, y, l)
|
69
|
+
Call threeline(x, y, l)
|
70
|
+
|
71
|
+
x = 81
|
72
|
+
y = 141
|
73
|
+
Call threeline(x, y, l)
|
74
|
+
Call threeline(x, y, l)
|
75
|
+
Call threeline(x, y, l)
|
76
|
+
|
77
|
+
x = 62
|
78
|
+
y = 182
|
79
|
+
Call threeline(x, y, l)
|
80
|
+
Call threeline(x, y, l)
|
81
|
+
Call threeline(x, y, l)
|
82
|
+
|
83
|
+
End Sub
|
84
|
+
|
85
|
+
Sub threeline(x As Long, y As Long, ByVal l As Long)
|
86
|
+
|
87
|
+
Dim sp As Shape
|
88
|
+
For i = 1 To 3 '---3回処理を繰り返す
|
89
|
+
Set sp = Shapes.AddLine(beginx:=x, BeginY:=y, EndX:=x, EndY:=y + l)
|
90
|
+
sp.Rotation = i * 60
|
91
|
+
Next i
|
92
|
+
|
93
|
+
With Shapes.AddShape(msoShapeIsoscelesTriangle, x + l / 2 - 11, y + l / 2 / 2 - 4, 7, 7)
|
94
|
+
.Rotation = 90
|
95
|
+
End With
|
96
|
+
With Shapes.AddShape(msoShapeIsoscelesTriangle, x - 7, y, 7, 7)
|
97
|
+
.Rotation = 270
|
98
|
+
End With
|
99
|
+
|
100
|
+
x = x + 45
|
101
|
+
y = y - 5
|
102
|
+
|
103
|
+
End Sub
|
104
|
+
```
|
105
|
+

|
1
実行結果を添付
answer
CHANGED
@@ -45,6 +45,7 @@
|
|
45
45
|
y = y - 5
|
46
46
|
|
47
47
|
End Sub
|
48
|
-
|
49
|
-
|
50
|
-
```
|
48
|
+
```
|
49
|
+
実行結果を載せておきます。
|
50
|
+
シートの枠線は非表示にしています。
|
51
|
+

|