Hello everyone,

I am struggling with the following issue:

I have a range of data stored in excel (see below), and the values of each the 5 variables (condition, sub-cond and lables) are displayed in the labels of a userform for each row (by clicking a command button). The two conditions (1 and 2) do not have the same length (condition 2 has more rows than condition 1). Example of my range as stored in an excel worksheet is the following:

Condition....Sub_cond...Label1...Label2...Label3
1.................1..............a..........b1........x
1.................2..............a..........b2........x
1.................3..............a..........b3........x
2.................1..............c..........d1........y
2.................2..............c..........d2........y
2.................3..............c..........d3........y
2.................4..............c..........d4........y

Each time I initialize the userform, I would like to have a random order of display of the "Condition", eg. the program starts reading from the first row of Condition 2: first row (Sub-cond1) is displayed first, sub-cond2 second, and so on in the stored order in excel. Then, the program starts reading the first row of Condition 1, which is Sub-cond1 and so on (all information in a given row is displayed in labels of a userform). When each userform has displayed all rows with information in excel, for both condition 1 and 2, the procedure ends (number of rows is given and fixed).

So basically, I would like to randomize the order of display of the variable Condition (as in the example below), with no repetition.

Condition....Sub_cond...Label1...Label2...Label3
2.................1..............c..........d1........y
2.................2..............c..........d2........y
2.................3..............c..........d3........y
2.................4..............c..........d4........y
1.................1..............a..........b1........x
1.................2..............a..........b2........x
1.................3..............a..........b3........x


I would also like to generate a new variable that records the order of display of the Condition (tells me each time which Condition appeared first - 1 or 2).

I am a bit confused on how to do this - how many variables to declare, how many ranges, how to treat the fact that ranges are of different lengths, and so on.

Thank you very much for your help.