EXCEL中如何转置多行多列?

如何把左边的数据转置成右边的格式
2024-11-22 13:14:27
推荐回答(1个)
回答(1):

每5行转置到一行
试下这个 VBA
Sub aa()
Dim I
For I = 7 To Range("a65536").End(xlUp).Row Step 6
Range(Cells(I, "闹咐a"), Cells(I + 5, "a")).Select
Selection.Copy
Cells(Range("乱山F65536").End(xlUp).Row + 1, "f"哗弯中).Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Next
End Sub