Msgbox reports first #N/A it encounters in the entire workbook.

Anne Troy

New member
Joined
Mar 25, 2011
Messages
23
Reaction score
0
Points
0
I have posted this at Answers.Microsoft. I don't seem to be able to get the solution I need.

http://answers.microsoft.com/en-us/...g-vba-of/ba95b3d9-3b9f-45bb-8e7b-2b280bd57fcd

I have a workbook where I run quite a bit of code and copy a bunch of user-input data to arrange it for import (performed by SQL script).

Great.

Except the user needs to copy some data to another worksheet and use it there, too. Then...they see a typo and fix it. Now, I am trying to find ID's I've assigned and I can't because my vlookup now throws a #N/A.

So, when they try to finalize the data for import, I want to throw some error-checking in up front so they know they've got #N/As to fix. Most have learned how to fix it, but when the data is large, it can be a pain to check for it, so I want to check for it automatically.

The first #N/A that the code comes across should throw up a msg box that says "Error found at Sheet1!A1" or similar, and a button to go to that cell. Everything is halted, the user fixes the #N/A and runs the finalize again. The next #N/A will throw up a msgbox. And so on until no #N/As are found. If that's the case, the msgbox does NOT come up, my procedure will just call the next procedure.

So, something like:
Sub Finalize()
Call FindNAs
Call FinalizeMe
End sub

I need the FindNAs part.

:)

I am happy to email my real file to anyone on this board.
 
Back
Top