Hi,
The way I always do this sanity checking to ensure that all data has been entered is to use a single named cell in Excel, call it "Check" if you like.
Then for every item that needs to have been completed, in the Check Cell I put stuff like
Formula:
=IF(A10="",1,0)+IF(COUNTA(B2:B6)=5,0,1)
The idea being that when all relevant cells and conditions have been met the Check cell will be zero. Then your macro can simply read the Check Cell and proceed accordingly.
i.e.
IF(Range("Check")<>0 Then MsgBox "Please complete all the information"
You can build on this idea. For instance if say all of a column of values must be completed you can use say an =INDEX(MATCH()) pair of functions to find the first description which has not been included and read the result of that function into a message box tp tell the user which is the first item that has not been entered.
I find this approach far easier that using VBA and it's much easier to create functions to test the stuff you're trying to trap.
Bookmarks