Daten lösche
19.07.2007 17:57:00
kocky
ich habe eine UF mit der ich vorhandene Daten bearbeiten kann. Sie beinhaltet drei TextBoxen und zwei ComboBoxen. Funktioniert auch sowiet alles. Nur beim Löschen der Daten, wird nur der erste Daten Satz gelöscht. Die Daten stehen wie folgt in der Tabelle
A B C D E
Name Vorname Funktion Bereich AZPW
Mit der Combobox3 wähle ich den Namen aus und die anderer Felder werde automatisch gefüllt. Folgender Code beinhaltet die UF.
Private Sub
cmdQuit_Click()
Unload Me
End Sub
Private Sub ComboBox3_Change()
On Error Resume Next
Application.ScreenUpdating = False
TextBox2 = Format(Sheets("PW").Cells(ComboBox3.ListIndex + 2, 2))
TextBox3 = Format(Sheets("PW").Cells(ComboBox3.ListIndex + 2, 3))
ComboBox1 = Format(Sheets("PW").Cells(ComboBox3.ListIndex + 2, 4))
TextBox4 = Format(Sheets("PW").Cells(ComboBox3.ListIndex + 2, 5))
End Sub
Private Sub cmdDelete_Click()
Sheets("PW").Rows(ComboBox3.ListIndex + 1).Delete
UserForm_Initialize
End Sub
Private Sub UserForm_Initialize()
With ComboBox3
.RowSource = "PW!A2:A" & Sheets("PW").Cells(Rows.Count, 5).End(xlUp).Row
.ListIndex = Sheets("PW").Range("G2") - 1
End With
End Sub
Private Sub cmdSpeichern_Click()
Worksheets("PW").Activate
g = ComboBox3.ListIndex + 1
Cells(g, 2) = TextBox2.Value
Cells(g, 3) = TextBox3.Value
Cells(g, 4) = ComboBox1.Value
Cells(g, 5) = TextBox4.Value
sort2
End Sub
Kann mir jemand helfen um die Daten in A:E komplett zu löschen?
Gruß kocky