ExcelSwede
New Member
- Joined
- Mar 9, 2021
- Messages
- 13
- Office Version
- 365
- Platform
- Windows
Hi all helpful people. First, sorry about my English. I hope you´ll understand anyway.
I have several long mailinglists in Excel. One list for a specific purpose or a specific occation. Each list can include several adresses which can occure in another list. I will try to copy one list at a time, paste them into the same sheet and let the purpose for the list show in a specifik column. Then I want a macro to do this job:
Sub
sort by emailadress (col A)
Compare row 1 with row 2; row 2 with row 3; row 3 with row 4; and so on....
If two cells are equal, then column by column compare purposes and make the two compared rows similar. After being similar, i can delete one of the rows.
When all e-mailadresses are compared, I have a list where an emailadress only occure once, and for each emailaderess I can sort a column for a purpose and then copy the adresses that belongs to the desired purpose.
Endsub
Voilá!!
Starting position - duplicates of adresses
Sorted list
Comparing (illustrated by green cells)
Make rows silmilare
Delete one of the similare rows
Find, compare, make similare and delete one of next couple
If an emailadress occures more then twice (like dog, horse and pig below) I suppose its easiest to loop the macro several times until there is no more find couples.
In the end there is a sorted list and each emailadress has been saved with all different purposes.
Now, perhaps I want to email all adresses that are marked with purpose No 2, so I simply sort by that column and then select the adresses, copy and paste into Outlook.
All ExcelGuru's out there. Can this dream of mine became true?
Big hug for a clever solution.
ExcelSwede
I have several long mailinglists in Excel. One list for a specific purpose or a specific occation. Each list can include several adresses which can occure in another list. I will try to copy one list at a time, paste them into the same sheet and let the purpose for the list show in a specifik column. Then I want a macro to do this job:
Sub
sort by emailadress (col A)
Compare row 1 with row 2; row 2 with row 3; row 3 with row 4; and so on....
If two cells are equal, then column by column compare purposes and make the two compared rows similar. After being similar, i can delete one of the rows.
When all e-mailadresses are compared, I have a list where an emailadress only occure once, and for each emailaderess I can sort a column for a purpose and then copy the adresses that belongs to the desired purpose.
Endsub
Voilá!!
Starting position - duplicates of adresses
Sorted list
Comparing (illustrated by green cells)
Make rows silmilare
Delete one of the similare rows
Find, compare, make similare and delete one of next couple
If an emailadress occures more then twice (like dog, horse and pig below) I suppose its easiest to loop the macro several times until there is no more find couples.
In the end there is a sorted list and each emailadress has been saved with all different purposes.
Now, perhaps I want to email all adresses that are marked with purpose No 2, so I simply sort by that column and then select the adresses, copy and paste into Outlook.
All ExcelGuru's out there. Can this dream of mine became true?
Big hug for a clever solution.
ExcelSwede