Reputation: 25
want clear C1 cell value (Drop down cell) after I change A2 value to grater than 2.I have list box for A2 cell change.I followed below vba code.Need to modify it.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A2")) Is Nothing Then
If Me.Range("A2").Value > 2 Then
Range("C1").ClearContents
End If
End Sub
Upvotes: 0
Views: 275
Reputation: 8114
Unfortunately, changes made to cell A2 by selecting an item from the listbox will not trigger the Change event.
An alternative would be to use an ActiveX listbox, where you would have the Click event available for your listbox.
Or another alternative would be to assign a macro to your listbox, as @BigBen has mentioned in his comments.
Upvotes: 3