To get a list of all possible permutations, you could set up your sheet like this:
Data
<table style="BACKGROUND-COLOR: #ffffff; PADDING-LEFT: 2pt; PADDING-RIGHT: 2pt; FONT-FAMILY: Calibri,Arial; FONT-SIZE: 11pt" border="1" cellpadding="0" cellspacing="0"><colgroup><col style="WIDTH: 30px; FONT-WEIGHT: bold"><col style="WIDTH: 76px"><col style="WIDTH: 93px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"></colgroup><tbody><tr style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt; FONT-WEIGHT: bold"><td>
</td><td>A</td><td>B</td><td>C</td><td>D</td><td>E</td><td>F</td><td>G</td><td>H</td><td>I</td><td>J</td><td>K</td></tr><tr style="HEIGHT: 18px"><td style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">1</td><td>
</td><td style="TEXT-ALIGN: right">0</td><td style="TEXT-ALIGN: right">1</td><td style="TEXT-ALIGN: right">2</td><td style="TEXT-ALIGN: right">3</td><td style="TEXT-ALIGN: right">4</td><td style="TEXT-ALIGN: right">5</td><td style="TEXT-ALIGN: right">6</td><td style="TEXT-ALIGN: right">7</td><td style="TEXT-ALIGN: right">8</td><td style="TEXT-ALIGN: right">9</td></tr><tr style="HEIGHT: 18px"><td style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">2</td><td>Slot A</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td></tr><tr style="HEIGHT: 18px"><td style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">3</td><td>Slot B</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td></tr><tr style="HEIGHT: 18px"><td style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">4</td><td>Slot C</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td></tr></tbody></table>
And place the following code in a new module (credit goes to shg, I have just adapted his code):
Code:
Option Explicit
Sub SuitcaseKeyPermutations()
Dim avdKey As Variant
Dim nKey As Long
Dim nSlot As Long
Dim KeyRng As Range
Dim aiInx() As Long
Dim aiMin() As Long
Dim aiMax() As Long
Dim i As Long
Dim iRow As Long
Dim iCol As Long
Dim ws As Worksheet
Dim mySheets As Long
Const calc = "Calc"
Application.DisplayAlerts = False
Application.Calculation = xlCalculationManual
For Each ws In ActiveWorkbook.Worksheets
If Left(ws.Name, 4) = calc Then ws.Delete
Next
Set ws = ActiveSheet
sheets.Add
ActiveSheet.Name = calc & mySheets
Application.DisplayAlerts = True
ws.Range(Sheet1.Cells(1, 2).Address & ":" & Sheet1.Cells(1, Sheet1.Range("IV1").End(xlToLeft).Column).Address).Copy
Worksheets(calc & mySheets).Cells(1, Sheet1.Range("IV1").End(xlToLeft).Column + 2).PasteSpecial Transpose:=True
Set KeyRng = Worksheets(calc & mySheets).UsedRange.Columns(1)
ActiveWorkbook.Names.Add Name:="Keys", RefersTo:=KeyRng
avdKey = WorksheetFunction.Transpose(Range("Keys"))
nKey = UBound(avdKey)
nSlot = Application.CountA(Sheet1.Range("A:A"))
Worksheets(calc & mySheets).Columns(1).Resize(, nKey).ClearContents
ReDim aiInx(1 To nSlot)
ReDim aiMin(1 To nSlot)
ReDim aiMax(1 To nSlot)
For i = 1 To nSlot
aiMin(i) = 1
aiMax(i) = nKey
Next i
GrpPermute aiInx, aiMin, aiMax, True
Do While GrpPermute(aiInx, aiMin, aiMax)
If iRow = 50000 Then
sheets.Add
mySheets = mySheets + 1
ActiveSheet.Name = calc & mySheets
iRow = 0
End If
iRow = iRow + 1
ActiveWindow.ScrollRow = iRow
For iCol = 1 To nSlot
ActiveSheet.Cells(iRow, iCol) = avdKey(aiInx(iCol))
Next iCol
Loop
Application.Calculation = xlCalculationAutomatic
ActiveWorkbook.Names("Keys").Delete
End Sub
Function GrpPermute(aiInx() As Long, aiMin() As Long, aiMax() As Long, _
Optional bInit As Boolean = False) As Boolean
' shg 2007
' Changes array aiInx to the next permutation, varying elements between
' the min and max values in aiMin and aiMax. The three arrays must all
' be 1-based and the same size.
' To initialize aiInx so that the *next* call returns the first combination,
' call with bInit True.
' Init returns {aiMin(1), aiMin(2), ... aiMin(m) - 1}
' The first permutation is {aiMin(1), aiMin(2), ... aiMin(m)}
' The last is {aiMax(1), aiMax(2), ... aiMax(m)}
' Returns False when no more permutations exist
Dim i As Long
Dim m As Long
m = UBound(aiInx)
If bInit Then
For i = 1 To m - 1
aiInx(i) = aiMin(i)
Next i
aiInx(m) = aiMin(i) - 1
GrpPermute = True
Else
For i = m To 1 Step -1
If aiInx(i) < aiMax(i) Then
aiInx(i) = aiInx(i) + 1
Exit For
End If
aiInx(i) = aiMin(i)
Next i
GrpPermute = i > 0
End If
End Function
Then you would execute the macro from the sheet and it would give all possible permutations in a new sheet. To do it for more slots, like a four or five slot combination lock, you could just add Slot D and Slot E, for example, below Slot C in column A.