这是因为数组公式(ArrayFormula) 在 VBA 中不能自动调整行。解决方法是使用 VBA 将公式复制到每一行。例如:
Sub CopyArrayFormula() Dim LastRow As Long LastRow = Cells(Rows.Count, 1).End(xlUp).Row
Range("C2").AutoFill Destination:=Range("C2:C" & LastRow), Type:=xlFillDefault
End Sub
这个 VBA 代码将 C2 单元格中的公式自动填充到 C 列的每一行中。请根据自己的情况更改代码中的单元格范围和要填充的列号。