To install the code:- Right-click on the Home sheet tab.
- Select View Code from the pop-up context menu.
- Paste the code from below in the worksheet's code module.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range, FoundName As Range
If Not Intersect(Range("H:H"), Target) Is Nothing Then
For Each cell In Intersect(Range("H:H"), Target).Offset(, -7)
If cell.Value <> Empty Then
Set FoundName = Sheets("AfterAppointment").Range("F:F").Find(cell.Value, , xlValues, xlWhole, 1, 1, 0)
If Not FoundName Is Nothing Then FoundName.EntireRow.Range("E1,H1").ClearContents
End If
Next cell
End If
End Sub
Bookmarks