Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1.  
  2. Private Sub CommandButton2_Click()
  3.  
  4.  
  5. question_clear = MsgBox("Are you sure you want to check your test? ", vbYesNo + vbQuestion, "WARNING!")
  6. If question_clear = 7 Then Exit Sub
  7. If question_clear = 6 Then
  8. If OB1.Value = True Then count_of_good = count_of_good + 1
  9. If OB3.Value = True Then count_of_good = count_of_good + 1
  10. If OB9.Value = True Then count_of_good = count_of_good + 1
  11. If OB11.Value = True Then count_of_good = count_of_good + 1
  12. If OB13.Value = True Then count_of_good = count_of_good + 1
  13. If OB15.Value = True Then count_of_good = count_of_good + 1
  14. If OB16.Value = True Then count_of_good = count_of_good + 1
  15. If OB6.Value = True Then count_of_good = count_of_good + 2
  16. If OB5.Value = True Then count_of_good = count_of_good + 1
  17. If OB2.Value = True Then count_of_bad = count_of_bad + 1
  18. If OB4.Value = True Then count_of_bad = count_of_bad + 1
  19. If OB7.Value = True Then count_of_bad = count_of_bad + 1
  20. If OB8.Value = True Then count_of_bad = count_of_bad + 1
  21. If OB10.Value = True Then count_of_bad = count_of_bad + 1
  22. If OB12.Value = True Then count_of_bad = count_of_bad + 1
  23. If OB14.Value = True Then count_of_bad = count_of_bad + 1
  24. If OB17.Value = True Then count_of_bad = count_of_bad + 1
  25. End If
  26. If count_of_bad > count_of_good Then
  27. OB1.Value = False
  28. OB2.Value = False
  29. OB3.Value = False
  30. OB4.Value = False
  31. OB5.Value = False
  32. OB6.Value = False
  33. OB7.Value = False
  34. OB8.Value = False
  35. OB9.Value = False
  36. OB10.Value = False
  37. OB11.Value = False
  38. OB12.Value = False
  39. OB13.Value = False
  40. OB14.Value = False
  41. OB15.Value = False
  42. OB16.Value = False
  43. OB17.Value = False
  44. StName.Value = ""
  45. Surname.Value = ""
  46. ComboBox1.Value = "Group"
  47. question_clear = MsgBox("You are a bad person!")
  48. End If
  49. If count_of_bad < count_of_good Then
  50. OB1.Value = False
  51. OB2.Value = False
  52. OB3.Value = False
  53. OB4.Value = False
  54. OB5.Value = False
  55. OB6.Value = False
  56. OB7.Value = False
  57. OB8.Value = False
  58. OB9.Value = False
  59. OB10.Value = False
  60. OB11.Value = False
  61. OB12.Value = False
  62. OB13.Value = False
  63. OB14.Value = False
  64. OB15.Value = False
  65. OB16.Value = False
  66. OB17.Value = False
  67. StName.Value = ""
  68. Surname.Value = ""
  69. ComboBox1.Value = "Group"
  70. question_clear = MsgBox("You are a good person!")
  71. End If
  72.  
  73. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement