Created
February 13, 2013 04:10
-
-
Save tombrad/4942196 to your computer and use it in GitHub Desktop.
Prototipos VBA-2-6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub CommandButton1_Click() | |
Rem posicion del indice en la celda 1,1 | |
indice = Hoja1.Cells(1, 1) | |
Rem si el indice es cero se cambia a uno | |
If indice = "" Then | |
indice = 1 | |
Hoja1.Cells(1, 1) = indice | |
End If | |
Rem incrementa el indice en 1 lugar que es la fila donde debe grabar | |
indice = indice + 1 | |
Rem coloca el nuevo valor del indice -incrementado- en la celda 1,1 | |
Hoja1.Cells(1, 1) = indice | |
Rem escribe los contenidos de los textbox en la hoja 1 | |
Rem la fila es el valor del indice y la columna varia segun el contenido | |
Hoja1.Cells(indice, 1) = TextBox1.Text | |
Hoja1.Cells(indice, 2) = TextBox2.Text | |
Hoja1.Cells(indice, 3) = TextBox3.Text | |
Hoja1.Cells(indice, 4) = TextBox4.Text | |
Rem limpia todos los textbox | |
TextBox1.Text = "" | |
TextBox2.Text = "" | |
TextBox3.Text = "" | |
TextBox4.Text = "" | |
Rem coloca el foco en textbox1 | |
TextBox1.SetFocus | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment