Sie sind auf Seite 1von 3

Leccin 86 Private Sub BotnCerrar_Click() Unload Formulario End Sub

Private Sub BotnAceptar1_Click() If CampoNombre.Text = "" Then MsgBox "Por favor inserte su nombre" ElseIf CampoCiudad.Text = "" Then MsgBox "Por favor inserte ciudad"

Else ActiveWorkbook.Save End If End Sub

Private Sub CampoCiudad_Change() Cells(2, 2) = CampoCiudad.Text End Sub

Private Sub CampoNombre_Change() Cells(1, 2) = CampoNombre.Text End Sub '2 Private Sub BotnEdad_Change() Edad.Text = BotnEdad.Value End Sub

Private Sub Edad_Change()

Dim ValorEdad1 As Integer ValorEdad1 = Val(Edad.Text) BotnEdad.Value = ValorEdad1 End Sub

Private Sub BotnAceptar2_Click() If CheckBox1.Value = True Then Range("B1:B3").Font.Bold = True If BotnHombre.Value = True Then Range("B3") = "Hombre" If BotnMujer.Value = True Then Range("B3") = "Mujer" If BotnDesconocido.Value = True Then Range("B3") = "Desconocido"

Range("B4") = BotnEdad.Value End Sub '3 Private Sub BotnCerrar2_Click() Unload Formulario End Sub

Private Sub BotnAceptar3_Click() Range("B5").Value = ListBox1.ListIndex + 1 & "-" & ListBox1.Value Unload Formulario End Sub

Private Sub UserForm_Initialize() With ListBox1 .AddItem "Amarillo" .AddItem "Verde" .AddItem "Rojo" .AddItem "Azul"

End With End Sub

Das könnte Ihnen auch gefallen