回答編集履歴

2

▲対応版

2020/08/04 06:39

投稿

ttyp03
ttyp03

スコア16998

test CHANGED
@@ -99,3 +99,111 @@
99
99
  シートの枠線は非表示にしています。
100
100
 
101
101
  ![イメージ説明](3f5dd0dcfac8e1a6285f38e12bd3337f.png)
102
+
103
+
104
+
105
+ ---
106
+
107
+ ご要望のあった▲に対応したものを作ってみました。
108
+
109
+ ▲の書き方が適当(というか作りっぱなし)なのでたぶん正三角形にはなってないです。
110
+
111
+ なので相変わらずずれてますが、ご勘弁ください。
112
+
113
+ ```VBA
114
+
115
+ Sub test()
116
+
117
+ Dim x As Long
118
+
119
+ Dim y As Long
120
+
121
+ Dim l As Long
122
+
123
+
124
+
125
+ l = 60
126
+
127
+
128
+
129
+ x = 100
130
+
131
+ y = 100
132
+
133
+ Call threeline(x, y, l)
134
+
135
+ Call threeline(x, y, l)
136
+
137
+ Call threeline(x, y, l)
138
+
139
+
140
+
141
+ x = 81
142
+
143
+ y = 141
144
+
145
+ Call threeline(x, y, l)
146
+
147
+ Call threeline(x, y, l)
148
+
149
+ Call threeline(x, y, l)
150
+
151
+
152
+
153
+ x = 62
154
+
155
+ y = 182
156
+
157
+ Call threeline(x, y, l)
158
+
159
+ Call threeline(x, y, l)
160
+
161
+ Call threeline(x, y, l)
162
+
163
+
164
+
165
+ End Sub
166
+
167
+
168
+
169
+ Sub threeline(x As Long, y As Long, ByVal l As Long)
170
+
171
+
172
+
173
+ Dim sp As Shape
174
+
175
+ For i = 1 To 3 '---3回処理を繰り返す
176
+
177
+ Set sp = Shapes.AddLine(beginx:=x, BeginY:=y, EndX:=x, EndY:=y + l)
178
+
179
+ sp.Rotation = i * 60
180
+
181
+ Next i
182
+
183
+
184
+
185
+ With Shapes.AddShape(msoShapeIsoscelesTriangle, x + l / 2 - 11, y + l / 2 / 2 - 4, 7, 7)
186
+
187
+ .Rotation = 90
188
+
189
+ End With
190
+
191
+ With Shapes.AddShape(msoShapeIsoscelesTriangle, x - 7, y, 7, 7)
192
+
193
+ .Rotation = 270
194
+
195
+ End With
196
+
197
+
198
+
199
+ x = x + 45
200
+
201
+ y = y - 5
202
+
203
+
204
+
205
+ End Sub
206
+
207
+ ```
208
+
209
+ ![イメージ説明](6fcdfe716573c5e4da69b64246a6283f.png)

1

実行結果を添付

2020/08/04 06:39

投稿

ttyp03
ttyp03

スコア16998

test CHANGED
@@ -92,8 +92,10 @@
92
92
 
93
93
  End Sub
94
94
 
95
+ ```
95
96
 
97
+ 実行結果を載せておきます。
96
98
 
99
+ シートの枠線は非表示にしています。
97
100
 
98
-
99
- ```
101
+ ![イメージ説明](3f5dd0dcfac8e1a6285f38e12bd3337f.png)