|
▼himuro さん:
あるいは(ほとんど同じですが)
Sub Test2()
Dim f As Variant
Dim t As Variant
Dim r As Range
Dim i As Long
Dim j As Long
Dim x As Long
Dim mx As Long
'以下はあくまでテストデータ
ReDim f(1 To 10)
For x = 1 To UBound(f)
f(x) = "data" & x
Next
'ここから処理
x = 1
mx = UBound(f)
For Each r In Range("alpha").Areas
'あくまで、領域の中の1かたまりごとの処理
ReDim t(1 To r.Rows.Count, 1 To r.Columns.Count)
For i = 1 To UBound(t, 1)
For j = 1 To UBound(t, 2)
'それぞれの領域のそれぞれのセルに何をいれたいのかがわからないので
'適当な値を埋め込み
If x <= mx Then
t(i, j) = f(x)
Else
t(i, j) = Empty
End If
x = x + 1
Next
Next
r.Value = t 'alpsha内の1つの領域にまとめて書きこみ
Next
End Sub
|
|