You are on page 1of 4

Private Sub CmdCalificaciones_Click()

Dim num1 As Double

Dim num2 As Double

Dim num3 As Double

Dim Resul As Double

num1 = (TextBox4.Text)

num2 = (TextBox5.Text)

num3 = (TextBox6.Text)

TextBox7.Text = (num1 + num2 + num3) / 3

End Sub

Private Sub CmdGuardar_Click()

Dim NombreHoja As String

Dim HojaDestino As Range

Dim NuevaFila As Integer

Dim Registro As Integer


NombreHoja = "Datos"

Set HojaDestino = ThisWorkbook.Sheets(NombreHoja).Range("A1").CurrentRegion

NuevaFila = HojaDestino.Rows.Count + 1

With ThisWorkbook.Sheets(NombreHoja)

.Cells(NuevaFila, 1).Value = Me.TextBox1.Value

.Cells(NuevaFila, 2).Value = Me.TextBox2.Value

.Cells(NuevaFila, 3).Value = Me.TextBox3.Value

.Cells(NuevaFila, 4).Value = Me.TextBox7.Value

End With

MsgBox "Datos Guardados correctamente"

TextBox1.Text = Empty

TextBox2.Text = Empty

TextBox3.Text = Empty

TextBox4.Text = Empty

TextBox5.Text = Empty

TextBox6.Text = Empty

TextBox7.Text = Empty
End Sub

Private Sub CommandButton1_Click()

TextBox1.Text = Empty

TextBox2.Text = Empty

TextBox3.Text = Empty

TextBox4.Text = Empty

TextBox5.Text = Empty

TextBox6.Text = Empty

TextBox7.Text = Empty

MsgBox "Datos Borrados"

End Sub

Private Sub ListBox1_Click()

Me.ListBox1.RowSource = "Datos!A2:D2"

Me.ListBox1.ColumnCount = 4

Me.ListBox1.ColumnHeads = True

End Sub

Private Sub UserForm_Click()


End Sub

You might also like