Excel VBA - sort email addresses inside of a merged range
Posted on 2011-10-16
I have multiple email addresses inside a named merged range rEmailDistrib. The email addresses are separated by semicolon, or comma, or colon, or space(s). I need to manipulate thus:
1) Leave all email addresses inside the merged range
2) Sort A-Z, one email address per line inside the merged range
3) Put semicolon at the end of each email address (get rid of all spaces)
For example, original contents of rEmailDistrib is:
firstname.lastname@example.org,email@example.com firstname.lastname@example.org; email@example.com: firstname.lastname@example.org
New content of rEmailDistrib would be...
Maybe the way to approach is by starting out with a "helper" worksheet cell containing "=Clean(rEmailDistrib)"