You are on page 1of 2

Private Sub CommandButton1_Click()

'DEFINICIÓN DE VARIABLES
Dim fin As Integer
Dim a As Double
Dim b As Double
Dim maximo As Double
Dim fibo As Double
If OptionButton1.Value = True Then
maximo = TextBox1.Value
If maximo = 0 Then a = 0 Cells(1, 1) = a
Else
a = 0 b = 1 Cells(1, 1) = Cells(2, 1) = i = Do Until maximo <= fibo
fibo = a + b Cells(i, 1) = fibo a = b = fibo i = i + 1
Loop
TextBox1.Text = "OptionButton1”. Value = False
End If
If OptionButton2.Value = True Then
If TextBox2.Text = "Then Beep”
MsgBox "Ingrese un valor entero en la opción Total de Elementos"
Else
fin = TextBox2.Text a = 0 b = 1
Cells(1, 1) = a Cells(2, 1) = b
For i = 1 To fin – 2 fibo = a + b Cells(i + 2, 1) = fibo
a = b b = fibo
Next
End If
TextBox2.Text = “ OptionButton2” .Value = False
End If
End Sub
Private Sub CommandButton2_Click()
Cells.Select
Selection.ClearContents
Range("A1").Select
End Sub
Private Sub CommandButton3_Click()
UserForm2.Show
End Sub
Private Sub CommandButton4_Click()
UserForm1.Hide
End Sub
Private Sub OptionButton2_Click()
End Sub
Private Sub UserForm_Click()
End Sub

You might also like