Excel VBA選取及轉置?

2017-09-27 12:15 pm
資料筆數向下新增不固定,如下
0 a1
1 a2
2 a3
3 b1
4 b2
5 b3
6 c1
7 c2
8 c3
.
.
.

以此類推,一次三筆資料,轉置放到sheet2(不增加其他任何欄位)

回答 (1)

2017-09-27 10:11 pm
Sub test()
Sheets("sheet1").Select
k = 1
Cx = -Int(-[A1048576].End(3).Row / 3)
For i = 1 To Cx
For j = 1 To 3
Sheets("sheet2").Cells(i, j) = Cells(k, 1)
k = k + 1
Next
Next
End Sub


收錄日期: 2021-05-03 06:47:22
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20170927041529AAz8IcM

檢視 Wayback Machine 備份