excel中多行多列转换成两列数据的宏代码?

2024-11-21 11:09:43
推荐回答(1个)
回答1:

Sub aa()
irow = Range("A65536").End(xlUp).Row
k = irow + 3
For i = 1 To irow
icol = Range("IV" & i).End(xlToLeft).Column
For j = 2 To icol
Cells(k, 1) = Cells(i, 1)
Cells(k, 2) = Cells(i, j)
k = k + 1
Next
Next
End Sub