Ich in folgendem Quellecode nur einzelene Spalten löschen und nicht alle Zellen.
If .Cells(i, 1) = ComboBox_name.Value Then
.Rows(i).ClearContents
nach clearcontents fehlt doch etwas.
danke vorab
columns("A").clearcontents
, oder
columns("A:C").clearcontents
oder
columns(1).clearcontents
(hier kenn ich keine mehrfachselection) oder
Range("a1:I5").ClearContents
Damit solltest du hoffentlich weiterkommen...With Worksheets("Tabelle1")
If .Cells(i, "A") = ComboBox_name.Value Then
Union(.Cells(i, "A"), .Cells(i, "D"), .Cells(i, "H"), .Cells(i, "S")).ClearContents
End If
End With
Gruß WernerDim spa As Long
If .Cells(i, 1) = ComboBox_name.Value Then
For spa = 1 To 20 '20 entsprechend letzter SPalte anpassen
Select Case spa
Case 4 To 7, 12, 14, 18 To 20 '1 = A, 2 = B usw.
.Cells(i, spa).ClearContents
End Select
Next
End If
Private Sub CommandButton4_Click()
Dim passwd As String
passwd = InputBox("Bitte Passwort eingeben.")
If passwd "küche" Then
MsgBox ("Passwort ist falsch!")
Exit Sub
End If
Dim i As Integer
Dim spa As Long
Worksheets("Übersicht").Activate
If Cells(i, 1) = ComboBox_name.Value Then
For spa = 1 To 69 '20 entsprechend letzter SPalte
Select Case spa
Case 1 To 2
Cells(i, spa).ClearContents
End Select
Next
End If
Das ist der gesamte Code. Ee kommt immer der Gelbe Pfeil auf der Zeile (If Cells(i,1) = ComboBox_name. Value Then