View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default How to get mutally exlusive cells on mouse click

Hi men@work -

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set surveyRange = Range("A1:F23")
If Not Intersect(Target, surveyRange) Is Nothing Then
If Target = "" Then
tRow = Target.Row
Range(Cells(tRow, 2), Cells(tRow, 6)).ClearContents
'Call your code that enters the answer value here....
End If
End If
End Sub

----
Jay

" wrote:

I am working on a survey

I have a total of 22 questions in 5 groups. Each question can have
only 1 of 5 possible answers. The answers have a value attached such
as:

0-Not At All
1-Somewhat
2-Moderately
3-A Lot
4-Extremely

I have the questions listed down column A. The possible answers are
listed next to each question. For example:

Question in A2: Are you feeling sad?

Answer Text:
0-Not At All in B1
1-Somewhat in C1
2-Moderately in D1
3-A Lot in E1
4-Extremely in F1

When, for example, I click the empty cell C2 I have code which will
put the value "1" visibly into the cell. So I can therefore go click
on the right answers on the whole range of questions and everytime I
click on the "Answer" I get the proper value displayed.

This works great but I would like to take it one step further:

How can I make the "Answer" cells mutally exclusive? Right now it is
possible to click every cell and the corresponding value appears. But
per question only one answer out of the 5 choices is allowed.

How can I do this?