I don't see my resaponse in my server so I'm sending it again. Otto
The file consists of a sheet named "Main" and a hidden sheet named "Clues".
The first macro goes in the sheet module of the Main sheet.
The second macro goes in the workbook module.
The third macro goes into a regular module.
The Clues sheet contains all the clues, as well as 4 possible answers for
each clue, only one of which is the correct answer. All the correct answers
are in Column F as well.
D1 of the main sheet is a DV cell that displays the 4 possible answers for
the current clue, which is displayed in Column B.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("D1")) Is Nothing Then
If IsEmpty(Target.Value) Then Exit Sub
With Sheets("Clues")
If Target.Value <> .Range("TheAns").Value Then
MsgBox "Wrong answer. Try again.", 16, "WRONG"
Application.EnableEvents = False
Range("D1").ClearContents
Application.EnableEvents = True
Else
MsgBox "Correct! Continue to the next clue.", , "Correct"
End If
End With
End If
End Sub
Private Sub Workbook_Open()
With Sheets("Main")
If Not IsEmpty(.Range("B3").Value) Then
.Range("B3", .Range("B" & Rows.Count).End(xlUp)).ClearContents
End If
.Range("D1").ClearContents
End With
End Sub
Sub CluesAnswers()
Dim AllClues As Range
Dim LastClue As Range
Dim NextClue As Range
With Sheets("Clues")
Set AllClues = .Range("A2", .Range("A" & Rows.Count).End(xlUp))
If IsEmpty(Range("B3").Value) Then
Range("B3").Value = .Range("A2").Value
.Range("B2").Resize(, 4).Name = "Possibles"
.Range("F2").Name = "TheAns"
Else
Set LastClue = Range("B" & Rows.Count).End(xlUp)
Set NextClue = AllClues.Find(What:=LastClue.Value).Offset(1)
If IsEmpty(NextClue.Value) Then
MsgBox "There are no more clues."
Exit Sub
End If
LastClue.Offset(1).Value = NextClue.Value
NextClue.Offset(, 1).Resize(, 4).Name = "Possibles"
.Cells(NextClue.Row, 6).Name = "TheAns"
Application.EnableEvents = False
Range("D1").ClearContents
Application.EnableEvents = True
End If
End With
End Sub
Rachael
I have written a VBA driven file for you that does what you want, I
think. At least it will get you started. It consists of 3 macros in 3
different modules. You said that you are not familiar with VBA so it
wouldn't help you for me to post the macros. Send me an email and I'll
send
you the file. We can then go from there. My email address is
(e-mail address removed). Remove the "extra" from this address. HTH
- Show quoted text -
Can you post the macro on here so we can try it too? In case it's
something we might have to do as well.
Thanks!