Hi all,
I've got an SAP Script which I am running and once all the extracts have been done, I've added some VBA to create Formulas (VLOOKUPS) in cells and extend to the end of the last available row.
However when executing they keep failing as I am trying to use IFERROR the code fails, I'm a novice as I've said before.
Heres the portion of code;
If I change the formula to "=IFERROR(VLOOKUP(G2,'VLPODL Extract'!A:Q,2,FALSE),"")" thats what causes it to fall over. Any suggestions?
I've got an SAP Script which I am running and once all the extracts have been done, I've added some VBA to create Formulas (VLOOKUPS) in cells and extend to the end of the last available row.
However when executing they keep failing as I am trying to use IFERROR the code fails, I'm a novice as I've said before.
Heres the portion of code;
VBA Code:
Dim Lastrow As Long
Application.ScreenUpdating = False
Lastrow = Range("B" & Rows.Count).End(xlUp).Row
Range("L2").Formula = "=VLOOKUP(G2,'VLPODL Extract'!A:Q,2,FALSE)"
Range("L2").AutoFill Destination:=Range("L2:L" & Lastrow)
Range("M2").Formula = "=VLOOKUP(G2,'VLPODL Extract'!A:Q,17,FALSE)"
Range("M2").AutoFill Destination:=Range("M2:M" & Lastrow)
Range("N2").Formula = "=VLOOKUP(A2,'Reason Codes Data'!A:B,2,FALSE)"
Range("N2").AutoFill Destination:=Range("N2:N" & Lastrow)
Application.ScreenUpdating = True
If I change the formula to "=IFERROR(VLOOKUP(G2,'VLPODL Extract'!A:Q,2,FALSE),"")" thats what causes it to fall over. Any suggestions?