Você está na página 1de 7

COLEGIO SAN JOS NORTE

INSTITUCIN EDUCATIVA DISTRITAL


REA: Matemticas Docente: Kelly Ximena Triana
Bernal
Nombre ___________________________________________________ Curso:
______________
EJERCICIO 1: Elabore el siguiente formulario. El programa deber
registrar los datos del cliente en una hoja de Excel.

Private Sub ComboBox1_Change()

End Sub

Private Sub CommandButton1_Click()


ult = Cells(Rows.Count, 1).End(xlUp).Row
If OptionButton1.Value = True Then
Cells(ult + 1, 5) = OptionButton1.Caption
End If
If OptionButton2.Value = True Then
Cells(ult + 1, 5) = OptionButton2.Caption
End If
If OptionButton3.Value = True Then
Cells(ult + 1, 5) = OptionButton3.Caption
End If

End Sub
Private Sub CommandButton2_Click()
ult = Cells(Rows.Count, 1).End(xlUp).Row
Cells(ult + 1, 1) = TextBox4.Text
Cells(ult + 1, 2) = TextBox6.Text
Cells(ult + 1, 3) = TextBox5.Text
COLEGIO SAN JOS NORTE
INSTITUCIN EDUCATIVA DISTRITAL
REA: Matemticas Docente: Kelly Ximena Triana
Bernal
Nombre ___________________________________________________ Curso:
______________
Unload UserForm1
End Sub

Private Sub CommandButton3_Click()


ult = Cells(Rows.Count, 1).End(xlUp).Row
Cells(ult + 1, 4) = ComboBox1.Text
End Sub

Private Sub CommandButton4_Click()


dni = Trim(TextBox5.Text)
If Len(dni) = 8 And IsNumeric(dni) Then
MsgBox "DNI Vlido"
Else
MsgBox "DNI Incorrecto"
End If
End Sub

Private Sub UserForm_Activate()


ComboBox1.AddItem ("Chiclayo")
ComboBox1.AddItem ("Trujillo")
ComboBox1.AddItem ("Arequipa")
ComboBox1.AddItem ("Piura")
ComboBox1.AddItem ("Tumbes")

End Sub

EJERCICIO 2: REGISTRAR LOS DATOS DE UN CLIENTE PARA EL INGRESO


A CINE
COLEGIO SAN JOS NORTE
INSTITUCIN EDUCATIVA DISTRITAL
REA: Matemticas Docente: Kelly Ximena Triana
Bernal
Nombre ___________________________________________________ Curso:
______________

Private Sub CommandButton1_Click()


Sheets("Hoja2").Select
Ult = Cells(Rows.Count, 1).End(xlUp).Row
Cells(Ult + 1, 1) = TextBox1.Text
Cells(Ult + 1, 2) = TextBox2.Text
Cells(Ult + 1, 3) = TextBox3.Text
Cells(Ult + 1, 4) = ComboBox1.Text
Cells(Ult + 1, 6) = TextBox4.Text
Cells(Ult + 1, 7) = TextBox5.Text

If OptionButton1.Value = True Then


Cells(Ult + 1, 5) = OptionButton1.Caption
End If
If OptionButton2.Value = True Then
Cells(Ult + 1, 5) = OptionButton2.Caption
End If
If OptionButton3.Value = True Then
COLEGIO SAN JOS NORTE
INSTITUCIN EDUCATIVA DISTRITAL
REA: Matemticas Docente: Kelly Ximena Triana
Bernal
Nombre ___________________________________________________ Curso:
______________
Cells(Ult + 1, 5) = OptionButton3.Caption

End If

If OptionButton4.Value = True Then


Cells(Ult + 1, 8) = OptionButton4.Caption
End If
If OptionButton5.Value = True Then
Cells(Ult + 1, 8) = OptionButton5.Caption
End If

TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
ComboBox1.Text = ""

OptionButton1.Value = False
OptionButton2.Value = False
OptionButton3.Value = False
OptionButton4.Value = False
OptionButton5.Value = False

End Sub

Private Sub CommandButton2_Click()


TextBox5.Value = TextBox4.Value * 12

End Sub

Private Sub TextBox1_Change()

End Sub

Private Sub UserForm_Activate()


Ult = Cells(Rows.Count, 1).End(xlUp).Row
For x = 2 To Ult
ComboBox1.AddItem (Cells(x, 1))

Next

End Sub
COLEGIO SAN JOS NORTE
INSTITUCIN EDUCATIVA DISTRITAL
REA: Matemticas Docente: Kelly Ximena Triana
Bernal
Nombre ___________________________________________________ Curso:
______________

Private Sub Label1_Click()

End Sub

Private Sub Label2_Click()

End Sub

Private Sub Label4_Click()

End Sub

Private Sub OptionButton1_Click()

End Sub

Private Sub OptionButton4_Click()

End Sub

EJERCICIO 3
FORMULARIO PARA EL REGISTRO DE ALUMNOS
COLEGIO SAN JOS NORTE
INSTITUCIN EDUCATIVA DISTRITAL
REA: Matemticas Docente: Kelly Ximena Triana
Bernal
Nombre ___________________________________________________ Curso:
______________

Private Sub TextBox1_Change()

End Sub

Private Sub UserForm_Activate()


ComboBox1.AddItem "Ftbol"
ComboBox1.AddItem "Natacin"
ComboBox1.AddItem "Basquet"
ComboBox1.AddItem "Voley"

ComboBox2.AddItem "7:30 am - 9:30am"


ComboBox2.AddItem "10 am - 12 pm"
ComboBox2.AddItem "11:30 am - 1:30pm"

End Sub

Private Sub CommandButton1_Click()


Dim sexo As String

Sheets("Hoja1").Select
ult1 = Cells(Rows.Count, 1).End(xlUp).Row
ult1 = ult1 + 1

If OptionButton1.Value = True Then


sexo = "Femenino"
COLEGIO SAN JOS NORTE
INSTITUCIN EDUCATIVA DISTRITAL
REA: Matemticas Docente: Kelly Ximena Triana
Bernal
Nombre ___________________________________________________ Curso:
______________
Else
sexo = "Masculino"
End If

Cells(ult1, 1) = TextBox1.Text
Cells(ult1, 2) = TextBox5.Text
Cells(ult1, 3) = sexo
Cells(ult1, 4) = ComboBox1.Value
Cells(ult1, 5) = ComboBox2.Value
Cells(ult1, 6) = TextBox4.Text

End Sub

Private Sub CommandButton2_Click()


Unload UserForm1
End Sub

Você também pode gostar