如圖,請問VBA如何寫呢?
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