View Single Post
  #9   Report Post  
Max
 
Posts: n/a
Default

In case it's needed, how about a nice, easy to use, working sample file with
Myrna's subroutine implemented? A "Download File" link is available at:
http://flypicture.com?display=updone&id=qtr8kao=
File: MyrnaLarson_Combination_Permutation.xls

Right-click on "Download File" Choose "Save Target As .." and save the
file to your desired folder. Open the file from there (Do not open the file
direct from the download link). You would need to enable macros, of course!

Then to try it out for your situation,
In Sheet1
---------
List the numbers: 1 2 3 4 5 6 7 8 9
into A3: A11 (vertically down from A3)
(this list is the entire set)

Enter in A1: C (< C is to run "combination")
Enter in A2 the number of items (subsets to pick): 2 (say)
Then *select A1* ( important!), and click the button "ListPermutations"
The results will be written in col A in a new sheet (just to the left of
Sheet1), viz.:

1, 2
1, 3
1, 4
1, 5
....
....
6, 8
6, 9
7, 8
7, 9
8, 9

Then just go back to Sheet1, change the number in A2 to: 3
select A1 again, and click the button to run the sub.
The results will be written in col A in another new sheet (to the immediate
left of Sheet1), viz.:

1, 2, 3
1, 2, 4
1, 2, 5
....
....
6, 7, 9
6, 8, 9
7, 8, 9

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----