如何在VBA中使用R1C1引用?

我在下面的代码中得到1004错误,我不知道为什么。

Public Function SetFormulaAndPasteVals(in_range As Range, formula_str As String, start_row As Long, end_row As Long) Dim start_cell As Range Dim in_col As Long in_col = in_range.Column ' This is where I get the error Set start_cell = in_range.Range("R" & start_row & "C" & in_col) start_cell.Formula = formula_str If start_row < end_row Then start_cell.Copy Destination:=in_range.Range("R" & start_row + 1 & "C" & in_col & ":R" & end_row & "C" & in_col) Else start_cell.Copy Destination:=in_range.Range("R" & start_row - 1 & in_col & "C" & in_col & ":R" & end_row & "C" & in_col) End If Call CopyPasteValues(in_range) Application.CutCopyMode = False End Function 

如果可能的话,我试图避免必须引用列字母。 我不明白为什么它不喜欢范围函数中的R1C1引用。