View Single Post
 
Old 11-21-2011, 02:33 PM
Formulayeti Formulayeti is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Nov 2011
Posts: 1
Formulayeti is on a distinguished road
Default Simple VBA macro error

i have written some simple code in vba :
Code:
Dim numberCorrect As String
Dim UserName As Integer
Dim numberWrong As String
Sub YourName()
UserName = InputBox(Prompt:="Type Your Name")
MsgBox " Welcome to the Quiz " + UserName, vbApplicationModal, " Quiz"
End Sub
Sub Correct()
MsgBox " That is correct, move on " + UserName, vbApplicationModal, " Quiz"
numberCorrect = numberCorrect + 1
SlideShowWindows(1).View.Next
End Sub
Sub Wrong()
MsgBox " Sorry Thats the wrong answer " + UserName, vbApplicationModal, " Quiz"
numberWrong = numberWrong + 1
SlideShowWindows(1).View.Next
End Sub
Sub Start()
numberCorrect = 0
numberWrong = 0
YourName
SlideShowWindows(1).View.Next
End Sub
Sub Results()
MsgBox ("You Got " & numberCorrect & " out of " & numberWrong + numberCorrect & ", " & UserName), vbApplicationModal, " Quiz "
SlideShowWindows(1).View.Next
End Sub
When using either the YourName or Right or Wrong macros it doesnt skip a slide it just stays put!
can anyone help it would be much appreciated
Reply With Quote