Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
need list of unique values from array in memory
I'm working on a project, where I have several thousand records in an excel
sheet (each has 30+ columns of data). I'm doing various data manipulations, and all is going well so far. However, my co-worker/customer has asked for a new report, with the data segmented by the person who is responsible for each record. So, I have maybe less than 100 people that repeat throughout my thousands of records. To dynamically keep my code working, I need to pull a list of all responsible people from the data itself. So, I'm looking for a way to identify each "new" name as I cycle through the list. My approach is to go through each record and compare the name to a shorter list of the names I've already found, e.g. for i= 1 to 5000 tempName = MyArray(i,14) 'get the name for that record for p= 1 to 100 'my list of unique names if tempName = FoundNames(p) then exit for 'if I find the name, just else FoundName = False end if next If FoundName = False then FoundNamesCount = FoundNamesCount + 1 FoundNames(FoundNamesCount) = tempName End if next But I'm thinking there must be a better (and faster) way.... Suggestions? Thanks, Keith -- The enclosed questions or comments are entirely mine and don't represent the thoughts, views, or policy of my employer. Any errors or omissions are my own. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unique values in an array. | Excel Discussion (Misc queries) | |||
Returning an array of unique values? | Excel Worksheet Functions | |||
Array Formulas - Unique List from List with Duplicates | Excel Discussion (Misc queries) | |||
create an array with unique items IN MEMORY | Excel Worksheet Functions | |||
Frequncy of unique values in array | Excel Programming |