EXCEL 列轉行重複貼上VBA

請問VBA高手,C1到M1欄位中的每一筆資料,重複19筆複製貼上轉成行
如圖,請問VBA如何寫呢?

EXCEL 列轉行重複貼上VBA
2022-03-05 0:09 發佈
文章關鍵字 excel VBA
手邊沒有 Excel
這是 LibreOffice Calc 的程式碼
(如果急用的話可以先在 LibreOffice 上操作,存檔後再用 Excel 開啟)
Sub Main
Dim Sheet As Object
Dim StrVal As String
Dim I As Integer, J As Integer, K As Integer

Sheet = ThisComponent.getCurrentController.getActiveSheet
K = 1
For I = 2 To 12
StrVal = Sheet.getCellByPosition(I, 0).String
For J = 1 To 19
Sheet.getCellByPosition(0, K).String = StrVal
K = K + 1
Next J
Next I
End Sub
內文搜尋
X
評分
評分
複製連結
Mobile01提醒您
您目前瀏覽的是行動版網頁
是否切換到電腦版網頁呢?