Thread: random
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
N10 N10 is offline
external usenet poster
 
Posts: 141
Default random

SOmething along these lines would work

Simpe but effective


A B C
1 What is the Capital of France paris
2 What is Two and Two 4
3 What is the square root of 9 3
4 What is PI to 6 decimal places 3.14287
5 Do Fish swim yes
6 Do Birds fly no
7 Who is the PrimeMinister of England n10
8 Who wrote Shakespears Sonnets shakespear
9 Who composed Faures requime Mass faure
10 Are you always right no




Sub Questions()

' HIDEs Q/A

Rows("1:10").Select
Selection.EntireRow.Hidden = True


MsgBox ("Enter stop in the input box to end the test") & vbCr & (" You may
have 50 attempts * USE LOWER CASE ONLY * or numbers where appropriate ")


Dim x, y, attempts, ca As Integer
Dim question As String
Dim reply As String
Dim answer As String

For x = 1 To 50
Range("a1").Select

q = Int(Rnd() * 10)

Range("A1").Select
Do Until ActiveCell.Value = q
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell.Offset(0, 1).Select
question = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
reply = ActiveCell.Value

answer = InputBox(question)
If answer = "stop" Then Rows("1:10").Select
If answer = "stop" Then Selection.EntireRow.Hidden = False

If answer = "stop" Then Exit For
If answer = reply Then ca = ca + 1
attempts = attempts + 1
If answer = reply Then MsgBox ("ROCKING YOU GOT IT RIGHT")
If answer < reply Then MsgBox ("The response was incorrect ")
MsgBox ("YOU HAVE ANSWERED ") & attempts & (" QUESTIONS WITH ") & ca & ("
CORRECT ANSWERS SO FAR ") & vbCr & " " & vbCr & (" THE CORRECT ANSWER WAS
") & reply

Next


Rows("1:10").Select
Selection.EntireRow.Hidden = False


MsgBox (" YOU HAVE HAD ") & attempts & (" QUESTIONS WITH ") & ca & ("
CORRECT ANSWERS SO FAR")


End Sub



wrote in message
...
hi
It would be nice if you keep your replys to the original
post.
-----Original Message-----

yes Iwill like it to be interactive with input and

msgbox, the
questions I can put in the code itself they are basic its

for
memorization puposes, I will like it to be random so it

does not ask
the questions in the same order everytime, so

memorization is more
effective.

????


--
nyn04
----------------------------------------------------------

--------------
nyn04's Profile: http://www.excelforum.com/member.php?

action=getinfo&userid=12658
View this thread:

http://www.excelforum.com/showthread...hreadid=261991

.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.766 / Virus Database: 513 - Release Date: 17/09/2004