Let's see if we can get there all the way :)
Give the following code a try in a copy of your workbook:
Dim mFind As Range
For Each cell In Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row)
Set mFind = Columns("B").Find(cell.Value)
If Not mFind Is Nothing Then
Set mFind = Columns("C").Find(cell.Value)
If Not mFind Is Nothing Then mFind.ClearContents
For Each cell In Range("C2:C" & Range("A" & Rows.Count).End(xlUp).Row)
If cell.Value = vbNullString Or cell.Value = 0 Then cell.Offset(0, 2).Value = "x"
Since you asked for a formula and instead get a macro code, here is how to use it:
How to implement and run a code:
- From Excel hit Alt + F11 to open the “Microsoft Visual Basic” window.
- Go to the top menu in the newly opened window > Insert > Module.
- Paste the code in the big white field.
- You can now close this window.
- Back at Excel, hit Alt + F8 to display the available macro’s.
- Double-click the macro you wish to run.
macro’s cannot be reversed using the blue arrows. Always make sure you save your file (or create a back up to be entirely sure) before running a code, so you can re-open your file if something unforeseen happens or you want to go back to the situation before the code was run.