When choosing 3 balls out of 5 where order does not matter and without repetitions:
----------
# combinations = nCr
= n!
(n-r)! r!
= 5!
(5-3)! 3!
= 5!
2! 3!
= 10

Does anyone have VBA code that will generate the 10 combinations? The code needs to be flexible so that n and r can vary. For example if the 'n' numbers were 10 20 30 40 and 50, and 'r' is 3 the result should be:
10 20 30
10 20 40
10 20 50
10 30 40
10 30 50
10 40 50
20 30 40
20 30 50
20 40 50
30 40 50