Mads.R
Mads.R

Reputation: 11

Excel Macro: Run-time Error 1004

I am making an Excel Macro, but keeps getting Run-time error 1004: on this piece of code.

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)"

Upvotes: 0

Views: 397

Answers (1)

Scott Craner
Scott Craner

Reputation: 152450

you have way too many " and you are not properly concatenating the formula with 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)"

Upvotes: 4

Related Questions