ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Populate Comment on the basis of Text Box Entry (https://www.excelbanter.com/excel-programming/403680-populate-comment-basis-text-box-entry.html)

EE[_2_]

Populate Comment on the basis of Text Box Entry
 
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

Jimmy Pena

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





All times are GMT +1. The time now is 01:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com