|
- Sub Main()
- With Sheet1
- .Range("F:P").ClearContents
- ReDim res(0 To 999)
- r = 2: c = 6
- While .Cells(r, 2).Value <> ""
- ar = .Range("B" & r & ":D" & r).Value
- ReDim br(1 To 1000, 1 To 1)
- n = 0
- For i = 1 To Len(ar(1, 1))
- For j = 1 To Len(ar(1, 2))
- For k = 1 To Len(ar(1, 3))
- n = n + 1
- br(n, 1) = Mid(ar(1, 1), i, 1) & Mid(ar(1, 2), j, 1) & Mid(ar(1, 3), k, 1)
- res(Val(br(n, 1))) = 1
- Next
- Next
- Next
- .Cells(2, c).Resize(n).Value = br
- c = c + 1
- r = r + 1
- Wend
- r = 2
- For i = 0 To 999
- If res(i) <> 1 Then .Cells(r, "P").Value = Format(i, "000"): r = r + 1
- Next
- End With
- End Sub
复制代码 |
|