Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am having a bit of trouble with arrays. I have created two list arrays which are of different sizes and have some of the same numbers in them. I want to go through one list and compare every element within it with every element on the second list. I need to find out (basically) which numbers are in the first array but not the second. The outline of the code i am using is as follows: i = 1 j = 1 For i = LBound(array1) To UBound(array1) Do While array1(i) < array2(j) For j = LBound(array2) To UBound(array2) If j = UBound(array2) Then ~~~Return Some Values~~~ GoTo GetOut Else: End If Next j Loop GetOut: Next i The problem lies in that although there are no bugs in my code the macro is returning all the data (as if the lists had nothing in common). Hope someone can help me!! Thanks a lot Tom ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
comparing ranges/arrays | Excel Worksheet Functions | |||
Elements and Arrays in Excel | Excel Worksheet Functions | |||
Comparing 2 arrays | Excel Worksheet Functions | |||
Comparing Arrays | Excel Discussion (Misc queries) | |||
Comparing Arrays | Excel Worksheet Functions |