Excel宏:运行时错误1004

时间:2017-09-27 14:26:14

标签: excel vba excel-vba

我正在制作一个Excel宏,但在这段代码中不断得到运行时错误1004:

FormulaR1C1 = "=IFERROR(""VLOOKUP(""(Active.Workbook.Sheets(""Sheet1(CT)"").Range(""E2"")),Application.Goto Workbooks(""Cycle time list of products.xls"").Sheets(""Sheet1"").Range(""A1:C300"")"",""3"",""FALSE"")"",0)"

1 个答案:

答案 0 :(得分:4)

你有太多"并且你没有正确地将公式与vba连接:

.Formula = "=IFERROR(VLOOKUP(" & ActiveWorkbook.Sheets("Sheet1(CT)").Range("E2").Address(0,0,,1) & "," & Workbooks("Cycle time list of products.xls").Sheets("Sheet1").Range("A1:C300").Address(1,1,,1) & ",3,FALSE),0)"