Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Field validation via control button?

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?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Field validation via control button?

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

"ExcelNoviceGuy" wrote in
message ...
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?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Field validation via control button?

Possibly. If your code is controlling the move, then don't move if you
find a question unanswered.

--
Regards,
Tom Ogilvy

ExcelNoviceGuy wrote in message
...
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?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OLE control for workbook hidden field Greg Luce[_2_] Excel Discussion (Misc queries) 1 December 14th 07 03:38 PM
Control Button jai Excel Discussion (Misc queries) 2 August 25th 07 07:26 AM
Control box and button oxicottin Excel Discussion (Misc queries) 4 January 23rd 07 03:03 PM
How can I control the positioning of the Comments field? GregRTI Excel Discussion (Misc queries) 1 January 9th 06 05:59 PM
How do you control the font size of the data validation field? jeffwamp Excel Discussion (Misc queries) 1 January 6th 06 01:08 AM


All times are GMT +1. The time now is 11:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"