Oct 17 2022 04:15 AM - edited Oct 17 2022 09:02 AM
Hi,
The VLOOKUP works but returns #N/A for all non matches. IFERROR results in blank cells.
Dim lastRow As Long
lastRow = Cells(Rows.Count, 2).End(xlUp).Row
Range("AF2:AF" & lastRow).FormulaR1C1 = "=IF(AND(RC[-9]>350, RC[-11]>25, RC[-11]<90), IF(COUNTIF(C[-15], RC[-15])>1, IF(LARGE(C[-31],1)=RC[-31], ""Duplicate Check"", """"),""""),"""")"
Range("AF2:AF" & lastRow).Value = Range("AF2:AF" & lastRow).Formula
Range("AG2:AG" & lastRow).FormulaR1C1 = "=VLOOKUP(RC[-19],New Sheet[[Name]:[Exists]],5,0)"
Oct 17 2022 08:52 AM
Oct 17 2022 08:59 AM
Oct 17 2022 09:09 AM
SolutionWhat is New Sheet? Table names cannot contain spaces...
IFERROR works like this when you specify it in VBA:
Range("AG2:AG" & lastRow).FormulaR1C1 = "=IFERROR(VLOOKUP(RC[-19],New_Sheet[[Name]:[Exists]],5,FALSE),"""")"
Oct 18 2022 12:38 AM
Oct 17 2022 09:09 AM
SolutionWhat is New Sheet? Table names cannot contain spaces...
IFERROR works like this when you specify it in VBA:
Range("AG2:AG" & lastRow).FormulaR1C1 = "=IFERROR(VLOOKUP(RC[-19],New_Sheet[[Name]:[Exists]],5,FALSE),"""")"