Populating a comments cell

tmcshane224

New Member
Joined
Jan 31, 2011
Messages
30
Hi there,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
What is the best way to populate a comments cell based on answers selected? Also, how would I write the code for it?
<o:p></o:p>
Let’s say that cell <o:p></o:p>
A2 has an "a"<o:p></o:p>
B2 has an "a"<o:p></o:p>
C2 has an "a" and lastly <o:p></o:p>
D2 is blank<o:p></o:p>
<o:p></o:p>
F4 has a text comment "There are exposed electrical outlets in patient areas." related to A2, <o:p></o:p>
<o:p> </o:p>
G4 has a text comment "The fire extinguisher(s) need to be serviced. The last serviced date is __." related to B2 and <o:p></o:p>
<o:p> </o:p>
H4 has a text comment "was/were pleasant and helpful." related to D2<o:p></o:p>
<o:p></o:p>
I need the comment cell to have the text from F4 & G4 populated in it as they have been answered with an "a". <o:p></o:p>
<o:p></o:p>
C2 has been answered but there is no text for that answer.<o:p></o:p>
<o:p></o:p>
Lastly I need it to be separated by &", "&

Thanks<o:p></o:p>
 
Correct, but my main goal is to get all comments in cell D101 no matter what question is answered.

A1-J1 is the questions with "a"

B2-B11 is the answers with "text"

So in the end we will have in D101: A1=B2 & C1=B4
 
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Try this macro: It uses helper cells in cells D102-D111:

Code:
Sub CombComments()
Dim r As Long

For r = 1 To 10
   If Cells(1, r) = "a" Then
      Cells(r + 101, 4).Formula = Cells(r + 1, 2)
   Else
   End If
Next r
Cells(101, 4).FormulaR1C1 = "=R[1]C& "", "" &R[2]C& "", ""&R[3]C& "", "" &R[4]C& "", ""&R[5]C& "", "" &R[6]C& "", ""&R[7]C& "", "" &R[8]C& "", ""&R[9]C& "", "" &R[10]C"
Rows(102 & ":" & 111).EntireRow.Hidden = True
End Sub

Edit*** Added the last line of code to hide rows 102-111
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,525
Messages
6,179,319
Members
452,905
Latest member
deadwings

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top