USING THE TEXT BOX AND COMMANDBUTTON FOR FILL IN THE BLANK
Private Sub CommandButton1_Click()
If [Link] = "perfect form" Then
MsgBox "Correct! Nice Work"
Else: MsgBox "Opps! Try Again"
End If
End Sub
Private Sub CommandButton3_Click()
If [Link] = "organic farming" Then
MsgBox "WONDERFUL JOB. You got it right!"
Else
MsgBox "I think you missed the other details. TRY AGAIN."
End If
End Sub
USING THE COMBO BOX
Private Sub ComboBox1_GotFocus()
If [Link] = 0 Then AddDropDownItems
End Sub
Sub AddDropDownItems()
[Link] "1"
[Link] "2"
[Link] "3"
[Link] "4"
[Link] = 4
End Sub
INTERACTIVE QUIZ WITH MS EXCEL LINK
Dim numCorrect As Integer
Dim numIncorrect As Integer
Dim userName As String
Dim qAnswered As Boolean
Sub SaveToExcel() 'ADDED
Dim oXLApp As Object
Dim oWb As Object
Dim row As Long
Set oXLApp = CreateObject("[Link]")
'On a Mac change \ to : in the following line
Set oWb = [Link]([Link] & "\" & "[Link]")
If [Link](1).Range("A1") = "" Then
[Link](1).Range("A1") = "Name"
[Link](1).Range("B1") = "Number Correct"
[Link](1).Range("C1") = "Number Incorrect"
[Link](1).Range("D1") = "Percentage"
End If
row = 2
While [Link](1).Range("A" & row) <> ""
row = row + 1
Wend
[Link](1).Range("A" & row) = userName
[Link](1).Range("B" & row) = numCorrect
[Link](1).Range("C" & row) = numIncorrect
[Link](1).Range("D" & row) = 100 * (numCorrect / (numCorrect +
numIncorrect))
[Link]
[Link]
End Sub
Sub GetStarted()
Initialize
YourName
[Link]
End Sub
Sub Initialize()
numCorrect = 0
numIncorrect = 0
qAnswered = False
End Sub
Sub YourName()
userName = InputBox("Type your name")
End Sub
Sub RightAnswer()
If qAnswered = False Then
numCorrect = numCorrect + 1
End If
qAnswered = False
MsgBox "You are doing well, " & userName
[Link]
End Sub
Sub WrongAnswer()
If qAnswered = False Then
numIncorrect = numIncorrect + 1
End If
qAnswered = True
MsgBox "Try to do better next time, " & userName
End Sub
Sub Feedback()
MsgBox "You got " & numCorrect & " out of " _
& numCorrect + numIncorrect & ", " & userName
SaveToExcel 'ADDED
End Sub