怎样可以转为一维表格
发布网友
发布时间:2022-05-01 09:13
我来回答
共1个回答
热心网友
时间:2022-06-27 07:52
用VBA如下:
Sub zz()
Dim amRng, refRng As Range
Set amRng = Sheet1.Range("A12")
For i = 1 To 4
For n = 1 To 6
Set refRng = Sheet1.Range("A3")
amRng.Offset(n, 0) = refRng.Offset(i, 0).Value
amRng.Offset(n, 1) = refRng.Offset(0, n).Value
amRng.Offset(n, 2) = refRng.Offset(i, n).Value
Next n
Set amRng = Sheet1.Cells(6 * i + 12, 1)
Next i
End Sub