Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have this information 3 questions all with slightly different outcomes dependant on the answers to them. The questions are 1. "Do you store any potentially sensitive information (e.g.customer details, account balance information or any memorable data relating to any customers) on a portable device? (If Y, ""Please state what sort of information is held"") (also if yes, ""Please state whether information is held on a pda or a laptop"")" 2. Do you have any commercial need to store information on your c-drive? (If Y. "Please state what the commercial need is") 3. Have you ever known of an incident in your area where a portable device has been lost or stolen? If y, "Please state y/n regarding whether there was any information that you were aware of was held on the c-drive at the time". If y to the second question, please state "What information was held on the c-drive and were you concerned that this information would be dangerous if it fell into the wrong hands?" So basically if they answer yes to 1. they need to fill one input box which puts the information in a cell next to it and then another input box in the cell after this. (If no - no action required) 2 - If they answer yes to this they just need to answer the one question which will be stored in the cell next to it. 3. - If they answer yes to the first question they have to answer another one and if the answer to this is yes then another question(inputbox) pops up. If no on either question than it stops asking questions. I can do a couple of these but I cannot make them all work together. Any help would be greatly appreciated. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Pasty, the following code should be placed in the standard VBA module of the
workbook you intend to use for your questionaire. In case you do not already know, to access the module press Alt+f11. That will open the VB editor, if the code area is dark, then do InsertModule. You should now see Module1 in the project window on the left of the screen and the code area should no longer be dark. copy this code into the module. You can then set a keyboard shortcut to run the code. It will first display a message box asking your questions. Then it will display an inputbox for answers. The questions and answers will then be entered on the active worksheet. You will need to designate which sheet to use. You can add line one to the code for "Worksheets(?).Activate to designate which sheet. Replace the ? with a sheet index number. Sub Questionaire() Dim Msg1, Msg2, Msg3, Msg4 Msg1 = "DO YOU STORE SENSITIVE CUSTOMER INFORMATION ON A PORTABLE DEVICE?" & Chr(13) & "a. Customer Details" & Chr(13) & "b. Account balances" & Chr(13) & "c. Memorable data relating to any cusomers" Msg2 = "DO YOU HAVE COMMERCIAL NEED TO STORE SENSITIVE INFORMATION ON YOUR WORKSTATION HARD DRIVE?" Msg3 = "TO YOUR KNOWLEDGE, HAS THERE BEEN ANY INCIDENT OF A PORTABLE DEVICE BEING LOST OR STOLEN IN YOUR WORK AREA?" Msg4 = "TO YOUR KNOWLEDGE WAS THERE ANY DATA ON THE HARD DRIVE THAT WOULD BE DETRIMENTAL TO BUSINESS OPERATIONS OR CUSTOMERS?" storeSI = MsgBox(Msg1, vbYesNo + vbQuestion) If storeSI = vbYes Then Range("A1") = Msg1 portDev = InputBox("ENTER THE TYPE OF PORTABLE DEVICE, WHETHER LAPTOP, PDA ETC.", "TYPE DEVICE") Range("a2") = portDev Range("a2").Font.ColorIndex = 5 End If storeCdrv = MsgBox(Msg2, vbYesNo + vbQuestion) If storeCdrv = vbYes Then Range("A4") = Msg2 HrdDrv = InputBox("ENTER A BRIEF DESCRIPTION OF THE NEED TO STORE THE DATA.i.e. HIGH SALES VOLUME, DAILY QUERIES, ETC.", "REASON TO STORE") Range("a5") = HrdDrv Range("A5").Font.ColorIndex = 5 End If portThft = MsgBox(Msg3, vbYesNo + vbQuestion) If portThft = vbYes Then Range("A7") = Msg3 Range("a8") = "Yes" Range("A8").Font.ColorIndex = 5 Response = MsgBox(Msg4, vbYesNo + vbQuestion) If Response = vbYes Then Range("A10") = Msg4 Range("a11") = "Yes" Range("A11").Font.ColorIndex = 5 Else Range("A10") = Msg4 Range("a11") = "No" Range("A11").Font.ColorIndex = 5 End If Else Range("a8") = "No" Range("A8").Font.ColorIndex = 5 End If End Sub "Pasty" wrote: Hi, I have this information 3 questions all with slightly different outcomes dependant on the answers to them. The questions are 1. "Do you store any potentially sensitive information (e.g.customer details, account balance information or any memorable data relating to any customers) on a portable device? (If Y, ""Please state what sort of information is held"") (also if yes, ""Please state whether information is held on a pda or a laptop"")" 2. Do you have any commercial need to store information on your c-drive? (If Y. "Please state what the commercial need is") 3. Have you ever known of an incident in your area where a portable device has been lost or stolen? If y, "Please state y/n regarding whether there was any information that you were aware of was held on the c-drive at the time". If y to the second question, please state "What information was held on the c-drive and were you concerned that this information would be dangerous if it fell into the wrong hands?" So basically if they answer yes to 1. they need to fill one input box which puts the information in a cell next to it and then another input box in the cell after this. (If no - no action required) 2 - If they answer yes to this they just need to answer the one question which will be stored in the cell next to it. 3. - If they answer yes to the first question they have to answer another one and if the answer to this is yes then another question(inputbox) pops up. If no on either question than it stops asking questions. I can do a couple of these but I cannot make them all work together. Any help would be greatly appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Questions on combo boxes and list boxes. | New Users to Excel | |||
How do I add input data in the input ranges in drop down boxes. | Excel Discussion (Misc queries) | |||
Two Quick Questions: Calling Subs & Text Input boxes | Excel Programming | |||
Mask input in input boxes? | Excel Programming | |||
2 questions about check boxes | Excel Programming |