VBA复制公式到最后一行然后下一列

我正在使用下面的代码,而我很难得到这个是在括号[CURRENT COLUMN]

我似乎不能使用当前使用的列来粘贴公式。

目标是从K列到END然后如果该列的第2行中有公式,则将该公式向下复制并继续到下一列。

 Option Explicit Sub recalcdash() Dim oWkbk As Workbook Dim oWkst As Worksheet Dim oRng As Range Dim LastCol As Long Dim LastRow As Long Dim StartCol As Integer Dim StartRow As Long StartCol = 11 Set oWkst = ActiveSheet LastRow = oWkst.Range("A" & oWkst.Rows.Count).End(xlUp).Row LastCol = oWkst.Cells(2, oWkst.Columns.Count).End(xlToLeft).Column For Each oRng In Range(Cells(2, 11), Cells(2, LastCol)) If oRng.HasFormula Then oRng.Copy Range(Cells(2, StartCol), Cells(LastRow, [CURRENT COLUMN])).PasteSpecial (xlPasteFormulas) End If Next oRng End Sub 

尝试修改

 Range(Cells(2, StartCol), Cells(LastRow, [CURRENT COLUMN])).PasteSpecial (xlPasteFormulas 

 Range(Cells(2, oRng.Column), Cells(LastRow, oRng.Column)).PasteSpecial (xlPasteFormulas)