|I know exactly what you want to do, but it appears that you missed my point.|
We are all volunteers here, offering our assistance for free. I assume that you wouldn't walk into a co-worker's office and just blurt out what you need and want. I assume you would ask nicely, and maybe even throw in a "Please" and/or a "Thank You" along with your requirements.
It should be no different when asking for help in an online forum.
You can do it without VBA:
I'm going to assume that your URLs are in Column A and that you do not have Column Labels in Row 1. If that's not the case, modify these instructions as required.
1 - Insert a new Column A
2 - Insert a new Row 1
3 - In A1 enter Domain
4 - In B1 enter URL
5 - In A2 enter this formula and drag it down:
This should put a list of Domain Names in Column A, which will include duplicates.
6 - Select the list of domain names, including A1
7 - Data...Filter...Advanced Filter
- a - Check "Copy to another location"
- b - Copy to: C1
- c - Check "Unique records only
This should put a list of unique Domain Names in Column C.
8 - In D2 enter this formula and drag it down:
This will find the first occurrence of each Domain Name in Column A and return the corresponding URL from column B.