Dim error As Integer
error = 0
Dim error_msg As String
error_msg = " { Choose an answer!}"
If (ComboBox1.Value = "") Then
error = 1
Label1.Caption = Label1.Caption & error_msg
End If
If (ComboBox2.Value = "") Then
error = 1
Label2.Caption = Label2.Caption & error_msg
End If
If (ComboBox3.Value = "") Then
error = 1
Label3.Caption = Label3.Caption & error_msg
End If
If (ComboBox4.Value = "") Then
error = 1
Frame1.Caption = Frame1.Caption & error_msg
End If
If (ComboBox5.Value = "") Then
error = 1
Frame2.Caption = Frame2.Caption & error_msg
End If
If (ComboBox6.Value = "") Then
error = 1
Frame3.Caption = Frame3.Caption & error_msg
End If
If (ComboBox7.Value = "") Then
error = 1
Frame4.Caption = Frame4.Caption & error_msg
End If
If (ComboBox8.Value = "") Then
error = 1
Frame5.Caption = Frame5.Caption & error_msg
End If
If (ComboBox9.Value = "") Then
error = 1
Frame6.Caption = Frame6.Caption & error_msg
End If
If (error = 1) Then
MsgBox "Please choose answers", vbInformation
Exit Sub
End If
Worksheets("dbase").Range("a1").End(xlDown).Select
ActiveCell.Offset(1, 0) = Now()
ActiveCell.Offset(1, 1) = ActiveCell.Offset(0, 1) + 1
ActiveCell.Offset(1, 2) = ComboBox1.Value
ActiveCell.Offset(1, 3) = ComboBox2.Value
ActiveCell.Offset(1, 4) = ComboBox3.Value
ActiveCell.Offset(1, 6) = ComboBox4.Value
ActiveCell.Offset(1, 7) = TextBox1.Value
ActiveCell.Offset(1, 8) = ComboBox5.Value
ActiveCell.Offset(1, 9) = TextBox2.Value
ActiveCell.Offset(1, 10) = ComboBox6.Value
ActiveCell.Offset(1, 11) = TextBox3.Value
ActiveCell.Offset(1, 12) = ComboBox7.Value
ActiveCell.Offset(1, 13) = TextBox4.Value
ActiveCell.Offset(1, 14) = ComboBox8.Value
ActiveCell.Offset(1, 15) = TextBox5.Value
ActiveCell.Offset(1, 16) = ComboBox9.Value
ActiveCell.Offset(1, 17) = TextBox6.Value
End Sub
Bookmarks