Dim I As Integer
Dim A As Double
Dim B As Double
Dim N As Double
Dim L As Double
With Hoja1
.Cells.Clear
N = Application.InputBox("COLOQUE Nº SECUENCIA", "NUMEROS DE LUCAS")
A = 2
B = 1
.Cells(1, 1) = "Nº DE SECUENCIAS"
.Cells(1, 1).Font.Bold = True
.Cells(1, 1).Interior.Color = vbBlue
.Cells(1, 1).Font.Color = vbWhite
.Cells(2, 1) = A
.Cells(3, 1) = B
For I = 1 To N
L = A + B
.Cells(I + 3, 1) = L
A = B
B = L
Next I
.Columns(1).AutoFit
End With
No hay comentarios