View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Ken Johnson Ken Johnson is offline
external usenet poster
 
Posts: 1,073
Default create automatic response to questions in excel....

On Dec 1, 6:39 am, felicia wrote:
Hi,
Is there a way in excel where I have 10 questions and can click on one
question and get the answer to pop up in my spreadsheet?

thank you,

Felicia


One way, with questions in A1:A10 and corresponding correct answers in
A1:A10 on a hidden worksheet with tab name "Answers"...

right click the tab of the sheet with the questions then select "View
code" from the popup menu and paste in the following code...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Cells.Count = 1 And _
Not Intersect(Target, Range("A1:A10")) Is Nothing And _
ActiveCell.Value < "" Then
Application.EnableEvents = False
MsgBox Sheets("Answers").Range(Target.Address).Value
Range("A11").Select
Application.EnableEvents = True
End If
End Sub

When you select a cell with a question the code produces a message box
with the correct answer.

Ken Johnson