View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default Track Maximum occurences in Array

See this recent thread in VB6:
http://groups.google.co.uk/group/mic...b48649b610e418

RBS

"ExcelMonkey" wrote in message
...
Does anyone know of a function which allows you to track the maximum count
of
items in an array? Lets say I have an array with repeating data (See
below).
I want to be able to track which item occurs the most # of times. The
answer below would be 3 occurences of the letter "a". I know I could buld
a
loop which tests each items against the data set and use a counter and
temp
variable to track and store the Max# of occurences. But is there a
combination of functions that would do the same?

TheArray(0) = "a"
TheArray(1) = "b"
TheArray(2) = "a"
TheArray(3) = "c"
TheArray(4) = "c"
TheArray(5) = "d"
TheArray(6) = "a"

Thanks