Hi all,
I cannot fathom why this returns syntax error. I've done all the fiddles and bits I know and it still gives it me. The formula works fine when i type it in but when i do it in a macro. Nope. Ive typed the macro, I've recorded the macro. Nothing. Its driving me up the wall !!!
I cannot fathom why this returns syntax error. I've done all the fiddles and bits I know and it still gives it me. The formula works fine when i type it in but when i do it in a macro. Nope. Ive typed the macro, I've recorded the macro. Nothing. Its driving me up the wall !!!
Code:
Sub Macro19_Lookup_Pallets()
Sheets("Rcom").Select
Range("Q1").Select
ActiveCell.FormulaR1C1 = "Pallets"
Range("Q2").Select
ActiveCell.FormulaR1C1 =
"=IF(RC[-16]="""","""",TRIM(CONCATENATE(RC[-3],"" "",IFERROR(IFERROR(IFERROR(IFERROR(VLOOKUP(RC[-1],Hydra!C[5]:C[6],2,FALSE),VLOOKUP(RC[-2],Hydra!C[5]:C[6],2,FALSE)),VLOOKUP(CONCATENATE(RC[-15],"" "",TEXT(RC[-13],""DD/MM/YYYY""),"" "",RC[-15],"" "",""missing"","" "",TEXT(RC[-13],""DD/MM/YYYY"")),Hydra!C[5]:C[6],2,FALSE)),VLOOKUP(CONCATENATE(RC[-15],"" "",TEXT(RC[-10]" & _
"/YYYY""),"" "",RC[-15],"" "",""missing"","" "",TEXT(RC[-10],""DD/MM/YYYY"")),Hydra!C[5]:C[6],2,FALSE)),""""))))"
Range("Q2").Select
Selection.AutoFill Destination:=Range("Q2:Q10131")
Range("Q2:Q10131").Select
Range("Q6").Select
Sheets("Home").Select
End Sub
Last edited by a moderator: