Excel excel中通过宏可否实现批量两列转置

2024-11-23 03:32:54
推荐回答(2个)
回答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

回答2:

当然可以,vba无所不能