Ich bin mit einem Problem noch immer nicht weiter gekommen und bitte daher nochmals um Hilfe.
Es geht die Änderung eines Datensatzes. Zur Zeit verwende ich folgenden Code. Allerdings sollte bei dem Code eigentlich nur nach der ID gesucht werden. So wird sie überschrieben, was ungünstig ist, da die Zelle eine Formel enthält. Es wäre nett, wenn mir jemand bei der Optimierung helfen könnte.
Private Sub CommandButton4_Click()
'Datensatz ändern
Sheets("B & A").Select
'Application.Run "Blattschutz_aus"
With Worksheets("B & A")
.Cells(rngFind.Row, 75) = TextBox15.Text 'ID
.Cells(rngFind.Row, 78) = TextBox8.Text 'Nachname
.Cells(rngFind.Row, 79) = TextBox9.Text 'Vorname
.Cells(rngFind.Row, 80) = TextBox10.Text 'Geb.datum
.Cells(rngFind.Row, 81) = TextBox11.Text 'Straße
.Cells(rngFind.Row, 82) = TextBox12.Text 'Hausnummer
.Cells(rngFind.Row, 84) = TextBox13.Text 'Wohnort
.Cells(rngFind.Row, 83) = TextBox14.Text 'Postleitzahl
.Cells(rngFind.Row, 77) = ComboBox6.Text 'Anrede
.Cells(rngFind.Row, 1) = ComboBox5.Text 'Tour
End With
Unload UserForm1
Sheets("B & A").Select
'Application.Run "Blattschutz_an"
Beispieldatei: https://www.herber.de/bbs/user/59903.xls
Gruß Frank