jjobrien03
New Member
- Joined
- Sep 2, 2014
- Messages
- 41
I am looking for VBA code to list all possible permutations of the data below (will never exceed 20 #s), with the following caveats:
Inputs needed:
# of numbers used ("number_chosen")
Conditional: If "Value" column is 0 then exclude from permutations
So in the below would be, for example, list all permutations of the below numbers which in excel formula would be PERMUT(8,3). Given two numbers are "0" in the value column
Output can be separated by a text character if that's easier but would prefer if they are pasted in adjacent columns (so in the below would be each number in three adjacent columns).
Appreciate any help you are able to provide!
Inputs needed:
# of numbers used ("number_chosen")
Conditional: If "Value" column is 0 then exclude from permutations
So in the below would be, for example, list all permutations of the below numbers which in excel formula would be PERMUT(8,3). Given two numbers are "0" in the value column
Output can be separated by a text character if that's easier but would prefer if they are pasted in adjacent columns (so in the below would be each number in three adjacent columns).
Appreciate any help you are able to provide!
# | Value |
1 | 1 |
2 | 1 |
3 | 1 |
4 | 1 |
5 | 0 |
6 | 1 |
7 | 1 |
8 | 0 |
9 | 1 |
10 | 1 |