'add list1 to the form,then add codes like this:
Dim all As New Collection
Private Sub Command1_Click()
getall "310-3-310-3-0-3-310-3-31-30-1-30-301"
End Sub
Sub fenjie(ByVal x As String, ByVal index As Integer)
If Len(x) = 25 Then Exit Sub
Dim temp
temp = Split(x, "-")
Dim temp2
temp2 = temp
all.Remove x
For i = 1 To Len(temp(index))
temp2(index) = Mid(temp(index), i, 1)
all.Add Join(temp2, "-"), Join(temp2, "-")
Next
End Sub
Sub getall(ByVal lottery As String)
Set all = Nothing
Dim temp
Dim num As Integer, i As Integer, j As Integer
temp = Split(lottery, "-")
num = 1
For i = 0 To 12
num = num * Len(temp(i))
Next
all.Add lottery, lottery
Do While Not all.Count = num
For j = 0 To 12
For i = 1 To all.Count
fenjie all(i), j
Next
Next
Loop
For i = 1 To all.Count
List1.AddItem "第" & Format(i, "00000") & "注: " & all(i)
Next
End Sub