-1
一直在執行鍵盤頭動機儀式試圖讓這個代碼塊的工作。VBA循環自動填充動態範圍
它試圖做的是從單元格引用(數值)創建一個範圍,然後在一列上自動填充公式,然後增加行數。這將運行,直到i等於projWeeks
projWeeks = 36
axisRow = 46
axisCol = 5
For i = 0 To projWeeks
axisRow = 46
Dim tStart As Range
Set tStart = outputSht.Cells(axisRow, axisCol)
Dim tDest As Range
tAxisCol = axisCol + 1
Set tDest = outputSht.Cells(axisRow, tAxisCol)
Selection.AutoFill Destination:=Range(tStart:tDest), Type:=xlFillDefault *///Crashes on Syntax*
axisRow = axisRow + 1
Set tStart = outputSht.Cells(axisRow, axisCol)
Set tDest = outputSht.Cells(axisRow, tAxisCol)
Selection.AutoFill Destination:=Range(tStart:tDest), Type:=xlFillDefault
axisRow = axisRow + 1
Set tStart = outputSht.Cells(axisRow, axisCol)
Set tDest = outputSht.Cells(axisRow, tAxisCol)
Selection.AutoFill Destination:=Range(tStart:tDest), Type:=xlFillDefault
axisRow = axisRow + 1
Set tStart = outputSht.Cells(axisRow, axisCol)
Set tDest = outputSht.Cells(axisRow, tAxisCol)
Selection.AutoFill Destination:=Range(tStart:tDest), Type:=xlFillDefault
axisCol = axisCol + 1
Next i
是否有參考,並增加細胞的位置運行這個循環另一種方式? VBA至少不是我的強項。