Kod:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Me.Range("B:B")) Is Nothing Then Exit Sub
If Target.Value <> "" Then
Target.Offset(0, -1) = Target.Row - 6
Me.Range("A7:A" & Me.Cells(Me.Rows.Count, "A").End(xlUp).Row).ClearContents
Else
Target.Offset(0, -1).ClearContents
End If
End Sub