Sub Quiniena()
Dim Fil As Long, Col As Integer, Tb(3) As String
Dim a As Byte, b As Byte, c As Byte, d As Byte, e As Byte, f As Byte, _
g As Byte, h As Byte, i As Byte, j As Byte, k As Byte, l As Byte, _
m As Byte, n As Byte
Tb(1) = "1"
Tb(2) = "X": Col = 1
Tb(3) = "2": Fil = 0
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
ActiveSheet.DisplayPageBreaks = False
For a = 1 To 3
For b = 1 To 3
For c = 1 To 3
For d = 1 To 3
For e = 1 To 3
For f = 1 To 3
For g = 1 To 3
For h = 1 To 3
For i = 1 To 3
For j = 1 To 3
For k = 1 To 3
For l = 1 To 3
For m = 1 To 3
For n = 1 To 3
Fil = Fil + 1:
If Fil = 1 Then Columnas (Col)
If Fil > 2 ^ 20 Then Fil = 1: Col = Col + 8
Cells(Fil, Col + 0) = Tb(a)
Cells(Fil, Col + 1) = Tb(b)
Cells(Fil, Col + 2) = Tb(c)
Cells(Fil, Col + 3) = Tb(d)
Cells(Fil, Col + 4) = Tb(e)
Cells(Fil, Col + 5) = Tb(f)
Cells(Fil, Col + 6) = Tb(g)
Cells(Fil, Col + 7) = Tb(h)
Cells(Fil, Col + 8) = Tb(i)
Cells(Fil, Col + 9) = Tb(j)
Cells(Fil, Col + 10) = Tb(k)
Cells(Fil, Col + 11) = Tb(l)
Cells(Fil, Col + 12) = Tb(m)
Cells(Fil, Col + 13) = Tb(n): DoEvents
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
ActiveSheet.DisplayPageBreaks = True
Application.CutCopyMode = False
End Sub
Sub Columnas(Col)
Dim a As Byte
For a = 0 To 13
Columns(Col + a).Select: Selection.ColumnWidth = 3
Next
Columns(Col + 14).Select: Selection.ColumnWidth = 12
Range(Cells(1, Col), Cells(2 ^ 20, Col + 13)).Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
End Sub