公式拖动查询

sac*_*hin 3 excel vba excel-vba

我试图使用以下代码将公式从范围拖到下一个立即列

Range(Cells(11, lc2), Cells(70, lc2)).AutoFill _
Destination:=Range(Cells(11, lc2 + 1), Cells(70, lc2 + 1)), Type:=xlFillDefault
Run Code Online (Sandbox Code Playgroud)

我正面临1004错误

请指教

QHa*_*arr 5

您正在使用的列lc2必须包含在目标中,例如

Range(Cells(11, lc2), Cells(70, lc2)).AutoFill _
Destination:=Range(Cells(11, lc2), Cells(70, lc2 + 1)), Type:=xlFillDefault
Run Code Online (Sandbox Code Playgroud)

这意味着您无法仅使用列自动填充 lc2+1

  • @sachin如果这个答案有助于您解决问题,请单击左侧的绿色V接受它 (2认同)