Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running Conditional If-then script off a command box
I am trying to set up a command box that will do two things conditionally if
clicked. First, I want to run script that will validate that text is present in a range of cells (all cells must have text values, although the text values may vary). If all of the cells in the range contain text, then the command button will take the user to the next sheet. If all the cells in the range do not have text, the command button will spawn a message box informing the user that all questions must be answered in order to continue. If anyone can help with this, I would appreciate it! I have been trying to figure this out for nearly a week! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running Conditional If-then script off a command box
Thank you for responding. I am attempting to create a multi-paged survey
through Excel. Page One contains 7 questions that the user must answer via Active X Combo Boxes. I linked the combo boxes to cells in the same sheet. When the user answers a question, the text appears in the linked cells. All the linked cells are in the same column (S11:S20). "jhyatt" wrote: is it all in one column. how many questions or how many cells are you looking at "Bucs85027" wrote: I am trying to set up a command box that will do two things conditionally if clicked. First, I want to run script that will validate that text is present in a range of cells (all cells must have text values, although the text values may vary). If all of the cells in the range contain text, then the command button will take the user to the next sheet. If all the cells in the range do not have text, the command button will spawn a message box informing the user that all questions must be answered in order to continue. If anyone can help with this, I would appreciate it! I have been trying to figure this out for nearly a week! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running Conditional If-then script off a command box
sorry forgot to add this to the end of the code
Worksheets("sheet2").Range("b4").Activate |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running Conditional If-then script off a command box
you could something like this just replace the cell value ie b1 with cells
that should contain the text. Sub AnswerQuestion() If b1 = "" Then MsgBox "All questions must be answered" Worksheets("Sheet1").Range("b1").Activate ElseIf b4 = "" Then MsgBox "All questions must be answered" Worksheets("Sheet1").Range("b4").Activate End If End Sub "Bucs85027" wrote: I am trying to set up a command box that will do two things conditionally if clicked. First, I want to run script that will validate that text is present in a range of cells (all cells must have text values, although the text values may vary). If all of the cells in the range contain text, then the command button will take the user to the next sheet. If all the cells in the range do not have text, the command button will spawn a message box informing the user that all questions must be answered in order to continue. If anyone can help with this, I would appreciate it! I have been trying to figure this out for nearly a week! |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running Conditional If-then script off a command box
is it all in one column. how many questions or how many cells are you looking
at "Bucs85027" wrote: I am trying to set up a command box that will do two things conditionally if clicked. First, I want to run script that will validate that text is present in a range of cells (all cells must have text values, although the text values may vary). If all of the cells in the range contain text, then the command button will take the user to the next sheet. If all the cells in the range do not have text, the command button will spawn a message box informing the user that all questions must be answered in order to continue. If anyone can help with this, I would appreciate it! I have been trying to figure this out for nearly a week! |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running Conditional If-then script off a command box
I will give this a shot. Thank you!
"jhyatt" wrote: sorry forgot to add this to the end of the code Worksheets("sheet2").Range("b4").Activate |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running Conditional If-then script off a command box
this should do the trick
Sub AnswerQuestion() Worksheets("Sheet1").Range("b1").Activate If ActiveCell.Value = "" Then MsgBox "All questions must be answered" Worksheets("Sheet1").Range("b1").Activate End If Worksheets("Sheet1").Range("b4").Activate If ActiveCell.Value = "" Then MsgBox "All questions must be answered" Worksheets("Sheet1").Range("b4").Activate Else ActiveWorkbook.Sheets("sheet2").Activate Worksheets("Sheet2").Range("b1").Activate End If End Sub "Bucs85027" wrote: I am trying to set up a command box that will do two things conditionally if clicked. First, I want to run script that will validate that text is present in a range of cells (all cells must have text values, although the text values may vary). If all of the cells in the range contain text, then the command button will take the user to the next sheet. If all the cells in the range do not have text, the command button will spawn a message box informing the user that all questions must be answered in order to continue. If anyone can help with this, I would appreciate it! I have been trying to figure this out for nearly a week! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problems running a dos program from vba script | Excel Programming | |||
Running a Script upon Saving a File | Excel Programming | |||
running vbs script from vba? | Excel Programming | |||
Compile error when running a vba script. | Excel Programming | |||
Running a VB Script | Excel Programming |