Build List Based On Criteria

J

John H

I have a list of True/False questions. When the user answers True, I want
that question to show in another column, if the answer is false, I want to
ignore it. For example:
A B
C
Dallas is located in Texas? True Dallas is
located in Texas
Houston is located in Texas? True Houston is
located in Texas
Oklahoma City is located in Texas? False El Paso is located
in Texas
El Paso is located in Texas? True San Antonio
is located in Texas
Austin is located in Arkansas? False
San Antonia is located in Texas?

Any ideas how to build the list in Column C

Thank you
 
B

Bernard Liengme

You will need VBA

Sub tryme()
mycount = Range("A1:A6").Count 'you need to adjust this to actual range
For j = 1 To mycount
If Cells(j, 2) = True Then
ccount = ccount + 1
Cells(ccount, 3) = Cells(j, 1)
End If
Next j
End Sub

If new to VBA see David McRitchie's site on "getting started" with VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm

best wishes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top