Lock combo from 5 tumblers with 10 letters each

Hughbie

New Member
Joined
Jul 5, 2019
Messages
1
I have padlock for my pool that has 5 rings with 10 letters each. I had to change the combo a few days ago and for the life of me i cant remember what i changed it to.
i have a list of the letters on each dial and wonder if i can use excel to come up with all possible combo of words using only the letters in the list.

any ideas?
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi & welcome to MrExcel
How about
Code:
Sub Hughbie()
   Dim ary As Variant, nary As Variant
   Dim r As Long, s As Long, t As Long, u As Long, v As Long, nr As Long

   ary = Range("A1:E10").Value
   ReDim nary(1 To UBound(ary) ^ UBound(ary, 2), 1 To 1)
   For r = 1 To UBound(ary)
      For s = 1 To UBound(ary)
         For t = 1 To UBound(ary)
            For u = 1 To UBound(ary)
               For v = 1 To UBound(ary)
                  nr = nr + 1
                  nary(nr, 1) = ary(r, 1) & ary(s, 2) & ary(t, 3) & ary(u, 4) & ary(v, 5)
               Next v
            Next u
         Next t
      Next s
   Next r
   Range("G1").Resize(nr).Value = nary
End Sub
 
Upvote 0
@Fluff - the reason I suggested my solution was that the OP specifically asked for all words from the letters, not all the possible combinations...
 
Upvote 0
So there are 100,000 combinations, and there are about 10,000 five-letter words (some uncommon). It would be straightforward to search a dictionary to list see how many words can be made.

What letters are on each dial?
 
Last edited:
Upvote 0
I wasn't sure whether the op meant proper words, or was simply using "words" generically, meaning any combination of letters.
 
Upvote 0
The only reason I thought real words was the backstory about a lock. Thinking that you think up memorable words for your combination. Either way looking at a picture of these kind of locks, I am not sure my solution is viable. Perhaps a combination of your solution and the use of

Code:
Cells.CheckSpelling

It's a trickier question than it initially appeared to be...
 
Upvote 0

Forum statistics

Threads
1,213,515
Messages
6,114,080
Members
448,548
Latest member
harryls

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