Try this:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("D2")) Is Nothing Then
Range("E" & Target.Row & ":F" & Target.Row).ClearContents
End If
End Sub
Or, if you want to check things for other rows, then maybe
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("D")) Is Nothing Then
If Target.Row = 2 Then
Range("E" & Target.Row & ":F" & Target.Row).ClearContents
End If
If Target.Row = 4 Then
' do some other stuff
End If
End If
End Sub
برچسب:
نویسنده: استخدام کار