Clearing a value when an option is selected from a drop down menu in Excel (VBA)

خرید بک لینک

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

Recent Questions...

ما را در سایت Recent Questions دنبال می‌کنید

برچسب: نویسنده: استخدام کار بازدید: 283 تاريخ: سه شنبه 5 مرداد 1395 ساعت: 14:07

صفحه بندی