Finding data

G

Guest

Using XL 2000

My worksheet contains 20 columns, A:T. The cells in each column (from row 2
down) contain either a "True" or "False" phrase.

I need a routine to loop through the 20 columns a row at a time.
Row 1 contains random text phrases.

Example;
Starting in Row 2, where the cell content in the first column (A) equals
"True", add the cell content in row 1 (A1) to a variable called CellString.
Continue, adding the content in B1, C1, D1 etc to CellString where the above
condition is met until the loop completes for that row.

When the loop for each row finishes I will transfer the content of
CellString to another cell in a different worksheet.

The loop repeats for as long as there is data in each row.

Any ideas appreciated.

Thanks, Paul
 
B

Bob Phillips

For j = 1 To Cells(1,Columns.Count).End(xlToLeft).Column
CellString = ""
Fo i = 2 To Cells(Rows.Count,j).End(xlUp).Row
If Cells(i,j).Value Then
CellString = CellString & Cells(1,j).Value
End If
Next i
'your code
Next j

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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