I've written some code that generates 2 numbers. Then it adds them together and stores that as a variable. Then prompts the question (number1 + number2)and stores the output of the inputbox as another variable.
^^I've declared all the variables, just havn't shown that^^Code:num1 = Int(Rnd * 10) + 1 num2 = Int(Rnd * 10) + 1 anws = num1 + num2 yansw = InputBox("What is " & num1 & " + " & num2 & "?", "Maths Question!")
Now this is where I am stuck.
Using an If Statement
I know I'm adding the numbers right, but the program is not executing the code when the yansw = anws. Can anyone point anything out? Or make it better?Code:If yansw = anws Then *snip* Else *snip* End If




Reply With Quote