tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,926
- Office Version
- 365
- 2019
- Platform
- Windows
Assume I have four numbers in a single row, 10, 20 ,30 ,40.
I would like to list off the possible combinations, ie 4C1, 4C2, 4C3, 4C4, where C is the Excel function Combin. Mathematically nCr = n!/[(n-r)!r!]
4C1 returns 4 results, 4C2 returns 6, 4C3 returns 4 and 4C4 returns 1.
The results should be:
How can this be done in VBA?
Thanks
I would like to list off the possible combinations, ie 4C1, 4C2, 4C3, 4C4, where C is the Excel function Combin. Mathematically nCr = n!/[(n-r)!r!]
4C1 returns 4 results, 4C2 returns 6, 4C3 returns 4 and 4C4 returns 1.
The results should be:
Code:
10
20
30
40
10,20
10,30
10,40
20,30
20,40
30,40
10,20,30
10,20,40
10,30,40
20,30,40
10,20,30,40
How can this be done in VBA?
Thanks