View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jimmy Pena Jimmy Pena is offline
external usenet poster
 
Posts: 4
Default Populate Comment on the basis of Text Box Entry

You could write event code to monitor the Change() event of the worksheet.

For example,

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$C$5" Then
Select Case Target.Value
Case "A"
'your code for option A
Case "B"
'your code for option B
Case "C"
'your code for option C
Case "D"
'your code for option D
End Select

' insert comment
Range("A1").AddComment "You selected " & Target.Value

End if
End Sub



HTH,
JP


"EE" wrote in message
...
Hi

I am building an small interactive questionnaire.

I am using Data Validation Lists to get responses for the questions. I
have a few questions where on the basis of the choice made, I need to
capture some more data. (currently I am thinking this could be a text
box though my ideal preference would be for a option button.). What I
want to know is if some text is entered in the box, is it possible for
me to insert that text as a "Comment" in the same cell?

Example: I have a list: A, B, C, D. On selecting C, I want a text
box / Option Button list to pop up. I either enter the text (or select
radio button). The entered text (or text associated with selected
radio button) should be populated as the comment for the cell.

This will significantly simplify my questionnaire design. It will also
help if you let me know how this would be different if the text can be
placed in another Cell (instead of a comment)

Any help is greatly appreciated.

Best
Prasad