You don’t provide much in the way of details (all the properties are the same type, or not? do you know how many columns in each case, or not?), so here is a shot in the dark:
I would suggest a multi-dimensional array. One row is one “group”. The question is how many columns do you need, and do you know how many columns are possible?
If the type of data differs, then an array of classes where each “column” is a property of the class, would be another possible solution.
Perhaps a dictionary?
If we understand the what and the why a bit better, I am certain that other more elegant or more efficient solutions can be suggested.
Create an array of GroupClass: DIM Groups() AS GroupClass
For each element of the array, define the high and low limits of that group
Then:
[code]DIM Groups() AS GroupClass ’ List of Groups
// Populate Groups array here
DIM Data() AS INTEGER ’ Array of data
// Populate Data array here
DIM Result() AS STRING
REDIM Result (Groups.Ubound)
FOR iGroup AS INTEGER = 0 TO Groups.Ubound
FOR iData AS INTEGER = 0 TO Data.Ubound
IF Data(iData) >= Groups(iGroup).Low AND Data(iData) <= Groups(iGroup).High THEN
Result(iGroup) = Result(iGroup) + Str (Data(iData)) + ", "
END IF
NEXT iData
NEXT iGroup
[/code]