Professional Documents
Culture Documents
VBA Quiz Code With Auto Results
VBA Quiz Code With Auto Results
VBA Quiz Code With Auto Results
Sub YourName()
UserName = InputBox(Prompt:="Type Your Name!")
MsgBox "Welcome: " + UserName, vbApplicationModal, "Sample Quiz"
End Sub
Sub Correct()
MsgBox " Well Done! That's The Correct Answer " + UserName, vbApplicationModal, "Sample Quiz"
numberCorrect = numberCorrect + 1
ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub Wrong()
MsgBox "Sorry! That's The Wrong Answer " + UserName, vbApplicationModal, "Sample Quiz"
numberWrong = numberWrong + 1
ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub Start()
numberCorrect = 0
numberWrong = 0
YourName
ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub Results()
MsgBox (" You Got " & numberCorrect & " Correct Answers, " & numberWrong & " Wrong Answers " & UserName), vbApplicationModal, "Sample Quiz"
End Sub