Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Worksheet_Change(ByVal Target As Range)
- Dim KeyCells As Range
- Set KeyCells = Range("B7:B100000")
- If Not Application.Intersect(KeyCells, Range(Target.Address)) _
- Is Nothing Then
- Call LoopMatch
- End If
- End Sub
- Sub LoopMatch()
- Dim Scanned, NotScanned As Range
- Dim i, j As Range
- Set Scanned = Worksheets("Main").Range("C7:C100000")
- Set NotScanned = Worksheets("Main").Range("J7:J100000")
- For Each i In Scanned.Cells
- For Each j In NotScanned.Cells
- If i.Value = j.Value Then
- Range("J" & j.Row & ":L" & j.Row).Delete
- Exit Sub
- Else
- End If
- Next j
- Next i
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement