Field validation via control button?

  • Thread starter Thread starter ExcelNoviceGuy
  • Start date Start date
E

ExcelNoviceGuy

Hey all,

I've created a survey in an Excel workbook which groups questions by
theme on different worksheets. The user moves between sheets via
control buttons. Is it possible to add to the macro of each button
code will check for completeness / no null values for question
responses on the current worksheet before allowing the user to move to
the next worksheet?
 
Basically,

Yes.

you need to check each cell containing a response, compile a response
string, and then use MsgBox to prompt the user to complete the cells.

eg.

Sub cmdNext_Click()
msg=""
If Range("A2")="" then
msg=msg & vbcrlf &"Cell A2"
End if
If Range("C2")="" then
msg=msg & vbcrlf &"Cell C2"
end if
.......
If msg<>"" then
msg="This Page is incomplete, please enter responses in:"
msgbox(msg)
else
your code to move to next page
end if
end sub
 
Possibly. If your code is controlling the move, then don't move if you
find a question unanswered.
 
Back
Top