Ich brauche etwas Hilfe bei eine Userform. Die beiden Checkboxen (siehe Code unten) sind noch ohne Funktion. Ich möchte, das wenn in der Userform eine Checkbox aktiviert wird, in der angebundenen Zelle ein "X" eingetragen wird. Kann mir jemand dabei helfen?
Private Sub CommandButton1_Click()
Sheets("B & A").Select
'Neuen Datensatz anlegen
Dim letzte_Zeile As Long
With Worksheets("B & A")
'Die letzte beschrieben Zeile in Spalte BZ ermitteln
letzte_Zeile = .Range("BZ3").End(xlDown).Row + 1
If letzte_Zeile > 95 Then
MsgBox "Die Kundenliste ist voll!", vbOKOnly
Exit Sub
End If
If TextBox1.Text = "" Then
MsgBox "Das Feld Nachname ist ein Pflichtfeld und darf nicht leer sein", vbOKOnly
ComboBox2.SetFocus
Exit Sub
End If
If ComboBox1.Text = "" Then
MsgBox "Bitte noch eine Anrede auswählen", vbOKOnly
ComboBox1.SetFocus
Exit Sub
End If
If ComboBox2.Text = "" Then
MsgBox "Bitte noch eine Tour auswählen", vbOKOnly
ComboBox2.SetFocus
Exit Sub
End If
.Cells(letzte_Zeile, 78) = TextBox1.Text 'Nachname
.Cells(letzte_Zeile, 79) = TextBox2.Text 'Vorname
.Cells(letzte_Zeile, 80) = TextBox3.Text 'Geb.datum
.Cells(letzte_Zeile, 81) = TextBox4.Text 'Straße
.Cells(letzte_Zeile, 82) = TextBox5.Text 'Hausnummer
.Cells(letzte_Zeile, 84) = TextBox6.Text 'PLZ
.Cells(letzte_Zeile, 83) = TextBox7.Text 'Ort
.Cells(letzte_Zeile, 77) = ComboBox1.Text 'Anrede
.Cells(letzte_Zeile, 1) = ComboBox2.Text 'Tour
'.Cells(letzte_Zeile, 86) = CheckBox1.Text 'Diab.
'.Cells(letzte_Zeile, 87) = CheckBox3.Text 'Kunde
End With
'ClearAll
Sheets("B & A").Select
Unload EaR_Kundenverwaltung_1
End Sub
Gruß tursiops