das heisst wenn in Spalte V Bereich 4 bis 35 das Wort "Nicht anwesend!" im Dropdownmenü gewählt wird soll die Zelle davor und die 4 Zellen danach einfach geleert werden (nicht umformatiert) Hier kommt immer ein object Fehler obwohl das Registert so heisst wie eingetragen?! was mache ich falsch?
Register Dashboard3 ist richtig ..und da soll die Routine automatisch greifen sobald in der Spalte der Wert aufgewählt wird..Vielen dank für die Hilfe..
ciao Sam
Private Sub Worksheet_Change()
'Check if the changed cell is in column V and row 4 to 35
If Target.Column = 22 And Target.Row >= 4 And Target.Row = 35 Then
'Check if the changed cell contains "Nicht anwesend!"
If Target.Value = "Nicht anwesend!" Then
'Check if the current worksheet is "Dashboard3"
If ActiveSheet.Name = "Dashboard3" Then
'If the cell contains "Nicht anwesend!", clear the cell before and 4 cells after
Target.Offset(-1, 0).ClearContents
Target.Offset(1, 0).ClearContents
Target.Offset(2, 0).ClearContents
Target.Offset(3, 0).ClearContents
Target.Offset(4, 0).ClearContents
End If
End If
End If
End Sub