Sub MakeValues()
Dim d As Object
Dim i As Long, j As Long
Dim strNbr As String
Dim lngChoices As Long
Dim mykeys
Dim strChoice As String
Dim lngPossibles As Long
'change these input box inputs to pull directly from spreadsheet
'if desired.
strNbr = Range("A1").Value
lngChoices = 3
Set d = CreateObject("Scripting.Dictionary")
'find out which digits are being used: get unique list
For i = 1 To Len(Trim(strNbr))
If Not d.exists(Mid(Trim(strNbr), i, 1)) Then
d.Add Mid(Trim(strNbr), i, 1), ""
End If
Next i
'mykeys is an array containing the unique values to
'get the combo's from
mykeys = d.keys()
Range("C:C").Clear
'hopefully we don't blow out the max size of i
'of course, if we do, we won't be able to
'output to a single column anyway :)
lngPossibles = d.Count
For i = 0 To (lngPossibles) ^ lngChoices - 1
strChoice = ""
For j = lngChoices - 1 To 0 Step -1
strChoice = strChoice & mykeys(Int(i / (lngPossibles ^ j)) Mod lngPossibles)
Next j
'change i+1 to i+x to start inputing in row x
Cells(i + 1, 3).NumberFormat = "@"
Cells(i + 1, 3) = strChoice
Next i
Set d = Nothing
End Sub