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: 100
Default If two lists don't match

Excel Experts,

I would like my code to determine if two lists, which consists of text
entries in cells in two columns are the same. If they aren't the same, I'd
like to end the procedure.

Specifically, the two possible sets of lists is similar to the following:

SITUATION 1
A B C D
1 CurSym Price DataSym DataPrice
2 AMD 22 ADM 23
3 HWP 30 HWP 31
4 INTC 21 INTC 22
5 MSFT 27 MSFT 28


SITUATION 2
A B C D
1 CurSym Price DataSym DataPrice
2 AMD 22 ADM 23
3 HWP 30 IBM 80
4 INTC 21 INTC 22
5 MSFT 27 MSFT 28


I want my code to check if the symbols in column D - DataSym match those in
Column A - CurSym.
If there is any discrepancy (such as SITUATION 2, in which IBM is in column
D and not the HWP in column A) I want the procedure to end.

If the symbols in D-DataSym match those in A-Cursym, I want to copy the
prices in E-DataPrice over those in B-Price.

What is the most effective way to do this?

Should I create two range variables and then create a For..Next loops that
would compare the corresponding elements in each list?

Or, would it be possible to load each list of symbols into an array and then
check if the two arrays hold the same symbols in the same order?

Thanks,
Alan


--
achidsey
 
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
INDEX and MATCH w/ Drop Down Lists Gayla Excel Worksheet Functions 0 March 19th 07 06:35 PM
I have 2 lists of email addresses and I want them to match up sgolland Excel Worksheet Functions 1 June 7th 06 02:19 PM
Drop down lists and vlookup? or Match? DarnTootn Excel Worksheet Functions 14 April 21st 06 06:56 PM
I am trying to match 2 lists Smish Excel Worksheet Functions 1 December 18th 05 08:27 PM
Match two lists and return a value mdeanda Excel Worksheet Functions 2 May 22nd 05 07:26 AM


All times are GMT +1. The time now is 08:04 AM.

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"