I have to run a report showing customer names, addresses and email addresses. Many times customers have the same email address as some other customer. I need to:
Can someone please help me come up with some code to automate this process?
- Sort the first worksheet (call it "Email1") by email address;
- Add a formula in the column next to the email column: "=IF(O2=O3, "Dup", "OK")" which tests to see if there are any duplicate email addresses in column O;
- Move all the fields of the rows showing "Dup" to a new worksheet (call it "Email2");
- Delete the Dup rows in Email1;
- Now I continue the same way with the worksheet Email2;
- I continue this way until the last worksheet has no duplicates email addresses in it.
Can someone please help me come up with some code to automate this process?