View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default EXCLUDING DUPES IN STRING ARRAY !!!!

John Walkenbach shows a way to use a collection in this code:
http://www.j-walk.com/ss/excel/tips/tip47.htm

He's actually filling a listbox with that unique list, but it should work ok.
And he also sorts the list -- you may find that useful, too.

jay dean wrote:

Hi -

B is a string var. In my code, if a certain condition is met, then store
B in th next available index of Arr(). However, before I store B, I need
to check that the current value of B does not already exist in Arr().

Is there a "faster" way to accomplish this, or I need to loop from
lbound(Arr) to Ubound(Arr) every time to check if the new value to be
stored already exists?

Thanks
Jay Dean

*** Sent via Developersdex http://www.developersdex.com ***


--

Dave Peterson