Hi, AZ16
Thank you for using Microsoft products and publishing them in the community.
Try this code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("E24")) Is Nothing Then
If Me.Range("E24").Value > 1 Then
Call DUPLICATES
End If
End If
End Sub
Sub DUPLICATES()
If Range("E24").Value > 1 Then
Cells(Rows.Count, "D").End(xlUp).Select
ActiveCell.ClearContents
ActiveSheet.Range("E24").Select
End If
End Sub
- Open an Excel workbook and press
Alt + F11to open the VBA editor. - In the Project Explorer on the left, locate and double-click on the worksheet containing cell E24 (e.g.
Sheet1).
I hope the above information can help you. Feel free to send a message if you need further help.
Best wishes
Aiden.C - MSFT |Microsoft Community Support Specialist