Nick Vaughn
New Member
- Joined
- Jul 24, 2011
- Messages
- 12
Can anyone help me out on this one. I would like to have a formula for Subsets.
Can we help? Maybe... it depends on what you mean by "subsets". We could try guessing at what your current setup is and what you ultimately want to do with it, but I'm thinking things would move more quickly if you told us.Can anyone help me out on this one. I would like to have a formula for Subsets.
I have some code which will do exactly this. Where would you like the combinations output to: the worksheet or a text file?I am looking for a formula that can give me all the possible 6 letter passwords from A to Z using Excel. Its bit time consuming with you have others important tasks to attend to and would also help a great deal not having duplicate passwords for my clients.
I said I'm not a statistics person, but I thought this was a "permutations" thing... how many ways can 6 items be made from 26 items? This is the permutations calculator that I used...I make it 26^6 or 308,915,776.
My laptop is telling me it'll take about five and a half hours to generate them to a worksheet.
Function Nick(ByVal d As Double, _
Optional iLen As Long = 0) As String
Dim avs As Variant
avs = Split("A B C D E F G H I J K L M N O P Q R S T U V W X Y Z", " ")
Do
Nick = avs(d - Int(d / 26) * 26) & Nick
d = Int(d / 26)
Loop While d > 0#
If Len(Nick) < iLen Then Nick = String(iLen - Len(Nick), avs(0)) & Nick
End Function