LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Need some help constructing a Do While statement

I would like to get information from column D of Sheet1 into column E of
Sheet2 where a one to many relationship exists between them (One row in
Sheet2 could have 0 to x matching rows in Sheet1). Column B in both sheets
contains the value (a text string) I want to compare. For each row in
Sheet2, the value of column B is always unique.

So for each row in Sheet2, I want to search Sheet1 to see if the values in
column B matches. If there is a match, then I want the value (a text
string) in column D of Sheet1 to be copied into Sheet2, column E. For any
additional matching rows in column B of Sheet1, then I want the value in
column D of Sheet1 to be appended to the value already contained in column E
of Sheet2. The data is Sheet1 is sorted on Column B, so whenever a match is
found in Sheet1, then the loop just needs to search the next row of Sheet1
until the values of column B don't match. At which point I need to go to
the next row in Sheet2 and start the comparison again.

I know this would require some type of Do While loops, but I'm not sure
where to begin as I haven't had much experience coding loops. Also, I'm not
sure how to append to the existing value in column E of Sheet2, since it
could change multiple times during the Do While. I assume that on each pass
of the Do While column B of Sheet1 matches column B of Sheet2, then I need
to update the value of the variable that stores the contents of column E in
Sheet2.

Anyway, what I want to do seems like it should be possible, and maybe it's
fairly easy to accomplish, but I need someone to point me in the right
direction. Thanks.

~Roger


 
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
Trouble constructing IF statement Joe[_13_] Excel Worksheet Functions 1 February 9th 09 06:16 PM
About xml constructing Reports to PDF files Excel Programming 1 January 5th 08 05:17 PM
Constructing a chart: HELP Johny Excel Programming 1 May 4th 06 05:16 PM
Help constructing simple spreadsheet Jeff Mason New Users to Excel 1 November 24th 05 04:51 PM
Constructing a Cell Reference olasa Excel Worksheet Functions 0 March 20th 05 12:30 AM


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

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

About Us

"It's about Microsoft Excel"