回答編集履歴

1

調整

2024/11/22 00:40

投稿

yambejp
yambejp

スコア116466

test CHANGED
@@ -9,3 +9,23 @@
9
9
  Next
10
10
  Range("a1:j10") = a
11
11
  ```
12
+
13
+ # セル指定の汎用化
14
+ ※上記が決め打ちすぎたので一応追記しておきます
15
+ ```VBA
16
+ Dim a()
17
+
18
+ Let x = 8
19
+ Let y = 7
20
+ Let offset_x = 2
21
+ Let offset_y = 3
22
+
23
+ ReDim a(x, y)
24
+
25
+ For i = 0 To x - 1
26
+ For j = 0 To y - 1
27
+ a(i, j) = i + j * x
28
+ Next
29
+ Next
30
+ Range(Cells(1 + offset_x, 1 + offset_y), Cells(x + offset_x, y + offset_y)) = a
31
+ ```