... or, "How 2 gracefully handle cell with formula error?"
I'm an experienced scripter, but still new to Excel VBA. I appreciate everyone's patience and help!
I have some "checker" (validation) code that loops through some rows of a worksheet, reads the value of a particular cell in each row as a string, examines it, looking for incorrect values based on some rules I've coded. It was quite an accomplishment to get that working! We were quite pleased with the early results. However, when I did some testing with some real-world data my code may run into, it crapped out when a cell's formula had an error ("#N/A").
I want to handle this scenario gracefully in my code. I do NOT want to skip the row and continue the loop using "On Error Resume Next". I want to determine the row contains a forumla error, post a message in a different cell in the current row, then carry on with the loop.
Can someone point me in the right direction? I am new to Excel VBA, so if I'm doing something fundamentally wrong and should take a different approach, by all means, say so. Or (hopefully), if I'm on the right track, and just need to add a few lines of code to deal with this error, let me know! I've included the code below.
Thanks in advance!
Bookmarks