[COLOR="DarkSlateGray"][B]Sub Arr(l&, b%)
Dim i&, j&, x&, uDat&, oDat()
uDat = CLng(b ^ l - 1)
ReDim oDat(0 To uDat + 1, 1 To WorksheetFunction.Max(1, l))
For i = 0 To uDat
x = i
For j = l To 1 Step -1
oDat(i, j) = x Mod b
x = (x - x Mod b) / b
Next j
Next i
With Cells(4, 1)
Range(.Cells, Cells(Rows.Count, 1).End(xlUp).Offset(1, .End(xlToRight).Column - 1)).ClearContents
.Resize(uDat + 2, WorksheetFunction.Max(1, l)).Value = oDat
End With
End Sub[/B][/COLOR]