Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you very much for all the responses.
I've chosen the one using the scripting dictionary. It seems the easiet one to use without any more tinkering. Herbert "AA2e72E" ... This solution does not use any objects/references: Sub array2Withoutarray1() array1 = Array(31.4, 41.1, 7, 15.4, 47.2, 90.4, 34.5, 58, 29.7, 8.9) array2 = Array(63.5, 75.3, 7, 1.8, 27.7, 34.5, 24.6, 34.7) result = Without(array2, array1) End Sub Function Without(ByVal Keep As Variant, ByVal Exclude As Variant) As Variant Keep = "," & Join(Keep, ",") For i = LBound(Exclude) To UBound(Exclude) Keep = Replace(Keep, "," & Exclude(i), "") Next If "," = Mid(Keep, 1, 1) Then Keep = Mid(Keep, 2) Without = Split(Keep, ",") End Function "Herbert Chan" wrote: Hello, I've two lists of data in array in VBA. How do I exclude the data in array1 from array2 so that I will be left with an array2 that does not contain any number in array1? I need this function in VBA. Thanks. Herbert |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I Exclude a list of dates in a date calculation? | Excel Worksheet Functions | |||
filtering a list to exclude 2 different dates | Excel Worksheet Functions | |||
Exclude cells that are the same as list in Excel 03 | Excel Discussion (Misc queries) | |||
list 1 has 400 names List 2 has 4000. find manes from list 1 on 2 | Excel Worksheet Functions | |||
HOW DO I TOTAL A FILTERED LIST TO EXCLUDE THOSE EXCLUDED BY FILTE. | Excel Worksheet Functions |