Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default How do I loop in EXCEL !! Pls EX-cel-erate me!!

Not sure I follow but if this is what you want -

On Sheet1 you have a list of names in col-A with two address fields in Col-B
and Col-C
On sheet 2 in col_A you also have a list of names. A name may or may not
match any in Sheet1 but if it does put the matching address in Col-B and
Col-C.

on Sheet2
in B1: =VLOOKUP($A1,Sheet1!A1:C100,2,FALSE)
in C1: =VLOOKUP($A1,Sheet1!A1:C100,3,FALSE)

change A1:C100 to the location and size of your table on sheet1
drag the formulas down

copy the formula cells and pasteSpecial values back to keep the values
without the formulas.

Regards,
Peter T


"bones288" wrote in message
...

1.Have to compare contents of 2 cells.

2. IS cell1 same as cell2 ?

3. If yes: then copy 2 cells of cell2 into cell1.

4. If no: then compare cell1 to the next cell in line after cell2.

4b. Now IS cell1 same as cell2b?

5. If yes: then copy 2 cells of cell2b into cell1.

6. Next cell1

7. IS new cell1 the same as cell2?

8. Repeat until cell1 = 'end of filled column' OR cell2= 'end of
filled column' OR (loop total count of cell1 column).
note: =IF(cell1=end&&cell2=end) THEN good routine ELSE 'error
routine'.


Example:

Two excel columns in two different worksheets:

a1-worksheet1 a1-worksheet2
alan paul
randy alex
rica sarah
todd sigmund

I want to compare all of the name in the first 'worksheet column' to
the names in the second 'worksheet column'.

Where we find a matching set of name (not necessarily in the same
locations; row# x column#) we want to match the contents of 2 cells in
either worksheet to the contents of the other.

before
alan 23 14_oak_lane alan

after
alan 23 14_oak_lane alan 23 14_oak_lane





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
How do I loop in EXCEL !! Pls EX-cel-erate me!! bones288[_2_] Excel Programming 1 April 19th 08 02:56 PM
returning back to loop check condition without completing the loop ashish128 Excel Programming 13 April 3rd 08 12:53 PM
Loop to Filter, Name Sheets. If Blank, Exit Loop ryguy7272 Excel Programming 3 February 5th 08 03:41 PM
(Complex) Loop within loop to create worksheets klysell Excel Programming 1 March 20th 07 12:03 AM
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM


All times are GMT +1. The time now is 07:10 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"