Hello, I've been trying to look for a post to help my situation but haven't... I'm trying to replace "ERROR" cells with existing data
I'm using a scanner to read multiple tiny barcodes at once. The issue is that the first time it can sometimes miss a couple barcodes to which it reads "ERROR", but can sometimes pick up those barcodes after scanning it a 2nd time (sometimes 3).
I tried using the "IF" statement where if it read the initial part of the barcode, it can assume to replace the cell that reads "ERROR" with the one with the true barcode. I also included "ERROR" as the false value when it was true (when there was indeed no barcode). I used "ISTEXT" since it wouldn't let me use a wildcard *
=IF(ISTEXT(N2),N2,"ERROR")
HOWEVER, that 2nd time the scanner can read "ERROR" to a barcode that was scanned successfully the 1st time. Which means that if I drag the "IF" formula all the way through, it will replace the barcode scanned the first time with "ERROR" from the 2nd scanned.
I'm not great at coding, and the internet said to turn to vba. I've tried threads that say to use REPLACE but they specify a word/number/string when I'm trying to replace with data that is already in the sheet AND not turn any barcodes back to "ERROR" from the 2nd scan.
Is there a way to combine Replace and an IF statement so I can do it all in one go? Also, this is my first post ever, so please let me know if none of this makes sense
Thanks!
I'm using a scanner to read multiple tiny barcodes at once. The issue is that the first time it can sometimes miss a couple barcodes to which it reads "ERROR", but can sometimes pick up those barcodes after scanning it a 2nd time (sometimes 3).
I tried using the "IF" statement where if it read the initial part of the barcode, it can assume to replace the cell that reads "ERROR" with the one with the true barcode. I also included "ERROR" as the false value when it was true (when there was indeed no barcode). I used "ISTEXT" since it wouldn't let me use a wildcard *
=IF(ISTEXT(N2),N2,"ERROR")
HOWEVER, that 2nd time the scanner can read "ERROR" to a barcode that was scanned successfully the 1st time. Which means that if I drag the "IF" formula all the way through, it will replace the barcode scanned the first time with "ERROR" from the 2nd scanned.
I'm not great at coding, and the internet said to turn to vba. I've tried threads that say to use REPLACE but they specify a word/number/string when I'm trying to replace with data that is already in the sheet AND not turn any barcodes back to "ERROR" from the 2nd scan.
Is there a way to combine Replace and an IF statement so I can do it all in one go? Also, this is my first post ever, so please let me know if none of this makes sense
Thanks!