Sie sind auf Seite 1von 2

Private Sub ALTA_Click() Application.ScreenUpdating = False Sheets("Lista de Clientes").Activate Range("a1").Activate Do While Not IsEmpty(ActiveCell) ActiveCell.Offset(1, 0).

Activate Loop ActiveCell = ComboBoxNIF On Error Resume Next Cells(ComboBoxNIF.ListIndex + 1, 1).Select ActiveCell.Offset(0, 1) = TextBoxNOMBRE ActiveCell.Offset(0, 2) = TextBoxDIRECCION ActiveCell.Offset(0, 4) = CDbl(TextBoxCP) ActiveCell.Offset(0, 3) = CDbl(TextBoxTELEF) ActiveCell.Offset(0, 5) = TextBoxEMAIL Range("G2").Copy ActiveCell.Offset(0, 6).PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False ComboBoxNIF = "" TextBoxNOMBRE = "" TextBoxDIRECCION = "" TextBoxCP = "" TextBoxTELEF = "" TextBoxEMAIL = "" UserForm7.Hide End Sub Private Sub BAJA_Click() If MsgBox("SEGURO QUE QUIERE ELIMINAR ESTE CLIENTE?", vbExclamation + vbYesNo) = vbYes Then ActiveCell.EntireRow.Delete SHIFT = xlUp ComboBoxNIF = "" TextBoxNOMBRE = "" TextBoxDIRECCION = "" TextBoxCP = "" TextBoxTELEF = "" TextBoxEMAIL = "" If MsgBox("EL CLIENTE HA SIDO ELIMINADO. Quiere cerrar el formulario?", vbInformation + vbYesNo) = vbYes Then UserForm7.Hide End If End If End Sub Private Sub CANCELAR_Click() ComboBoxNIF = "" TextBoxNOMBRE = "" TextBoxDIRECCION = "" TextBoxCP = "" TextBoxTELEF = "" TextBoxEMAIL = "" Do While Not IsEmpty(ActiveCell) ActiveCell.Offset(1, 0).Activate Loop ComboBoxNIF.SetFocus End Sub

Private Sub ComboBoxNIF_Change() Application.ScreenUpdating = False On Error Resume Next Sheets("Lista de Clientes").Activate Cells(ComboBoxNIF.ListIndex + 1, 1).Select UserForm7 - 2 TextBoxNOMBRE = ActiveCell.Offset(0, 1) TextBoxDIRECCION = ActiveCell.Offset(0, 2) TextBoxCP = ActiveCell.Offset(0, 4) TextBoxTELEF = ActiveCell.Offset(0, 3) TextBoxEMAIL = ActiveCell.Offset(0, 5) End Sub Private Sub ComboBoxNIF_Enter() Application.ScreenUpdating = False ComboBoxNIF.Clear Sheets("Lista de Clientes").Select Range("a1").Select Do While Not IsEmpty(ActiveCell) ComboBoxNIF.AddItem ActiveCell.Value ActiveCell.Offset(1, 0).Select Loop End Sub Private Sub UserForm_Activate() ComboBoxNIF = "" TextBoxNOMBRE = "" TextBoxDIRECCION = "" TextBoxCP = "" TextBoxTELEF = "" TextBoxEMAIL = "" ComboBoxNIF.SetFocus
End Sub