Hello all,
I have a possibly stupid question. I can get a formula to work for what I want, but when I attempt to add it to a macro that I have, I get an error.
The formula is =IFERROR(IF(VALUE(N2)=$BD$1," ",VLOOKUP(VALUE(LEFT(N2,3)),BD:BE,2,0)),"")
Which essentially looks up a code, compares it to a list I have in the spreadsheet, then returns something from another list, then if there is an error, it returns nothing. This works in the spreadsheet, but when I attempt to put that same formula in the VBA code I have, it breaks.
This is the code that works, before the IFERROR:
Range("ag" & I).Formula = "=IF(VALUE(n" & I & ")=$bd$1,"" "",VLOOKUP(VALUE(LEFT(n" & I & ",3)),BD:BE,2,0))"
But as soon as I attempt to add the Iferror, it breaks. Is there a different way to add iferror to a code in VBA?
This is for work, and has customer info, so I am not sure how much I can put in here, but if it is needed, I can try.
I have a possibly stupid question. I can get a formula to work for what I want, but when I attempt to add it to a macro that I have, I get an error.
The formula is =IFERROR(IF(VALUE(N2)=$BD$1," ",VLOOKUP(VALUE(LEFT(N2,3)),BD:BE,2,0)),"")
Which essentially looks up a code, compares it to a list I have in the spreadsheet, then returns something from another list, then if there is an error, it returns nothing. This works in the spreadsheet, but when I attempt to put that same formula in the VBA code I have, it breaks.
This is the code that works, before the IFERROR:
Range("ag" & I).Formula = "=IF(VALUE(n" & I & ")=$bd$1,"" "",VLOOKUP(VALUE(LEFT(n" & I & ",3)),BD:BE,2,0))"
But as soon as I attempt to add the Iferror, it breaks. Is there a different way to add iferror to a code in VBA?
This is for work, and has customer info, so I am not sure how much I can put in here, but if it is needed, I can try.