Excel多行多列转成一行多列

2025-01-07 09:31:53
推荐回答(2个)
回答1:

=INDEX($A$1:$E$10,ROUNDUP(COLUMN(A1)/COUNTA($2:$2),0),MOD(COLUMN(A1)+COUNTA($2:$2)-1,5)+1)   ,右拉至出现错误位止

回答2:

Sub AA()
Dim I, X
For I = 2 To Range("A65536").End(xlUp).Row
X = ActiveSheet.UsedRange.Columns.Count
Range(Cells(I, "A"), Cells(I, "e")).Copy Cells(1, X + 1)
Next
End Sub

试下