Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub btnEnviar_Click()
- Dim iFile As Long
- Dim ws As Worksheet
- Set ws = Worksheets(1)
- iFile = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
- If Trim(Me.txtNombre.Value) = "" Then
- Me.txtNombre.SetFocus
- MsgBox "Debe agregar un nombre"
- Exit Sub
- End If
- If Trim(Me.txtEmail.Value) = "" Then
- Me.txtEmail.SetFocus
- MsgBox "Debe agregar un email"
- Exit Sub
- End If
- ws.Cells(iFile, 1).Value = Me.txtNombre.Value
- ws.Cells(iFile, 2).Value = Me.txtEmpresa.Value
- ws.Cells(iFile, 3).Value = Me.txtEmail.Value
- ws.Cells(iFile, 4).Value = Me.txtTelefono.Value
- ws.Cells(iFile, 5).Value = Me.txtPoblacion.Value
- ws.Cells(iFile, 6).Value = Me.cbPais.Value
- ws.Cells(iFile, 7).Value = Me.txtMensaje.Value
- Me.txtNombre = ""
- Me.txtEmpresa = ""
- Me.txtEmail = ""
- Me.txtTelefono = ""
- Me.txtPoblacion = ""
- Me.cbPais = ""
- Me.txtMensaje = ""
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement