VBA to list all Possible Permutations w/ conditional

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!

#Value
11
21
31
41
50
61
71
80
91
101
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top