Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Finding data

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Finding data


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)


"Paulc" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding Data Mike Excel Discussion (Misc queries) 2 October 13th 09 03:24 PM
Finding data Byron720 Excel Discussion (Misc queries) 5 September 29th 09 10:54 PM
Finding data Finder2000 Excel Discussion (Misc queries) 1 August 8th 06 07:34 PM
Finding max row containing data... Dan Excel Discussion (Misc queries) 5 November 26th 05 09:33 PM
FINDING LAST ROW OF THE DATA SUDHENDRA Excel Programming 8 January 9th 04 11:02 PM


All times are GMT +1. The time now is 07:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"