I know there's a bazillion of these questions out there; but I've tried implementing things from various ones I've seen and haven't hit upon the right structure yet. I keep getting application/object defined errors. I'm sure it's the quotation marks but I can't seem to figure out where I have too many vs not enough. The end goal is for this formula to appear after a certain range of rows (newrows variable) and update dynamically as it fills down each row after that. 

I've tried removing the extra quotes around the string sections, but it then gives me an "Expected: end of statement" error near the beginning of the code. When I'm viewing it in Notepad ++ it looks correct, but still get the errors in VBA itself when running the macro in excel.

```
Range("R" & newrows & ":R1000").Formula = "=iferror(IF(""E""" & newrows & "= ""Planning"",VLOOKUP(""D""" & newrows & ",DataCheck4!A:F,3,FALSE),IF(""E""" & newrows & "=""Fieldwork"",VLOOKUP(""D""" & newrows & ",DataCheck4!A:F,4,FALSE),IF(""E""" & newrows & "=""Reporting"",VLOOKUP(""D""" & newrows & ",DataCheck4!A:F,5,FALSE),IF(""E""" & newrows & "=""Wrap Up"",VLOOKUP(""D""" & newrows & ",DataCheck4!A:F,6,FALSE),IF(""E""" & newrows & "=""Proj. Mgmt"",VLOOKUP(""D""" & newrows & ",DataCheck4!A:F,6,FALSE),"""")))))"

```

The code is supposed to be looking up a value based on the value of a cell in a row (Column E) and the name of a project (Column D). The newrows is a numerical variable being generated by a dynamic list. The top portion of the sheet has existing tasks I don't want to overwrite but I want this formula in all cells after the end row of that list. I've been learning VBA as I've been working on this project so it may be something I just haven't come across yet so I appreciate the help!

ETA: This morning I tried turning the sequence with newrows into a variable with the column letter instead and got the same application defined error.

```
firstloc = "E" & newrows
secondloc = "D" & newrows
Range("R" & newrows & ":R1000").Formula = "=iferror(IF(" & firstloc & "= ""Planning"",VLOOKUP(" & secondloc & ",DataCheck4!A:F,3,FALSE),IF(" & firstloc & "=""Fieldwork"",VLOOKUP(" & secondloc & ",DataCheck4!A:F,4,FALSE),IF(" & firstloc & "=""Reporting"",VLOOKUP(" & secondloc & ",DataCheck4!A:F,5,FALSE),IF(" & firstloc & "=""Wrap Up"",VLOOKUP(" & secondloc & ",DataCheck4!A:F,6,FALSE),IF(" & firstloc & "=""Proj. Mgmt"",VLOOKUP(" & secondloc & ",DataCheck4!A:F,6,FALSE),"""")))))"    

```