|
▼help さん:
こんにちは
エラーそのものは
Cells(n, 1).rezise(UBound(ss, 1), UBound(ss, 2)) = ss
この「Resize」のスペルミスでしょうけど、配列内の一部領域を他の配列に
一序に取り込むことはできません。
(セル領域についてはできるわけで配列でもできればいいんですけどね)
おやりになりたかったことは以下のようなことでしょうか?
Sub Test()
Dim myr As Variant
Dim cc() As Variant
Dim ss As Variant
Dim i As Long
Dim n As Long
Dim r As Long
Dim x As Long
Dim y As Long
Dim k As Long
With Range("a1").CurrentRegion
myr = .Value
.Clear
ReDim cc(1 To 4, 1 To UBound(myr, 2))
End With
n = 1
For i = 1 To UBound(myr, 1) Step 4
r = i + 3
k = 0
For y = i To r
k = k + 1
For x = 1 To UBound(myr, 2)
cc(k, x) = myr(y, x)
Next
Next
ss = WorksheetFunction.Transpose(cc) '配列の入れ替えたものをssに格納
Cells(n, 1).Resize(UBound(ss, 1), UBound(ss, 2)).Value = ss
n = n + UBound(ss, 1)
Next i
End Sub
|
|