Skip to content

Instantly share code, notes, and snippets.

@ochilab ochilab/judgeSample.vba

Last active Aug 27, 2015
What would you like to do?
Private Sub CommandButton1_Click()
Dim judge As Integer
Dim answer As Integer
Dim collect As Integer
With Worksheets("Sheet1")
collect = .Cells(MyNum + 1, 6)
End With
If OptionButton1.Value = True Then
answer = 1
ElseIf OptionButton2.Value = True Then
answer = 2
ElseIf OptionButton3.Value = True Then
answer = 3
ElseIf OptionButton4.Value = True Then
answer = 4
End If
If collect = answer Then
judge = 1
judge = 0
End If
If judge = 1 Then
MsgBox "正解"
MsgBox "残念"
End If
MyNum = MyNum + 1
showProblem (MyNum)
End Sub
Dim MyID As String
Public Property Let id(v_id As String)
MyID = v_id
End Property
Public Property Get id() As String
id = MyID
End Property
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.