I am trying to create a VBA code to do this formula:
=IFERROR(Vlookup(C3,PasteValues!$A:$F,6,0),IF(Q2="","",Q2))
I also want to copy this formula down into the entire column.
Dim LastRow As Long
Range("P:P").Copy Range("Q:Q")
LastRow = Range("P2:P" & Rows.Count).End(xlUp).Row
Range("P2:P" & LastRow).Formula = Application.WorksheetFunction.IFERROR(VLOOKUP(Range("C2"),Range("TableEmail!A:F"),6,FALSE),IF(Q2="","",C2))
When I tried this, the formula did not copy down/returned syntax error.