How do I separate a long string of emails with semi-colon?

The_ELK

New Member
Joined
Jul 1, 2015
Messages
17
Hello,

I have 1 Excel Cel (A1) with a long string of people email addresses without a bloody space. It's hard for me to insert this in Outlook without Outlook bombing out.

The Cell is like this as an example:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Yourname@email.comJAckTest@hotmail.comCNN@email.comNBA@cloud.comReception@compnay.com[/TD]
[/TR]
</tbody>[/TABLE]

What is the best formula to place a semi-colon between so that I can dump it in Outlook?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td]Yourname@email.comJAckTest@hotmail.comCNN@email.comNBA@cloud.comReception@compnay.com[/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]Yourname@email.com;JAckTest@hotmail.com;CNN@email.com;NBA@cloud.com;Reception@compnay.com;[/td][td][/td][td]=SUBSTITUTE(A1,".com",".com;")[/td][/tr]
[/table]


but I think this is not representative example

you can use nested SUBSTITUTE again for .org .net etc
 
Last edited:
Upvote 0
In the examples below, cell B1 is a formula that deals only with .com email domains. You can nest it similar formulas if your list contains other domains like .org, .gov, .edu, .....

Cell B2 is a UDF that posted below the examples. For me it's an easier way to deal with multiple domains. If you install it then it can be used just like a worksheet function as in cell B2.
Excel Workbook
AB
1Yourname@email.comJAckTest@hotmail.comCNN@email.comNBA@cloud.comReception@compnay.comYourname@email.com;JAckTest@hotmail.com;CNN@email.com;NBA@cloud.com;Reception@compnay.com
2Yourname@email.comJAckTest@hotmail.govCNN@email.orgNBA@cloud.comReception@compnay.eduYourname@email.com;JAckTest@hotmail.gov;CNN@email.org;NBA@cloud.com;Reception@compnay.edu
Sheet3


UDF Alternative
Code:
Function EmailDelim(S As String, Delim As String) As String
Dim Domain As Variant, i As Long
Domain = Array(".com", ".org", ".edu", ".gov") 'add other domain as required
For i = LBound(Domain) To UBound(Domain)
    S = Replace(S, Domain(i), Domain(i) & Delim)
Next i
EmailDelim = Left(S, Len(S) - 1)
End Function
 
Upvote 0
but I think this is not representative example
you can use nested SUBSTITUTE again for .org .net etc

perfect, works like a charm

luckily, all my domains end with [.com] hahaha, I wouldnt bother if I had a mixture!!
 
Last edited:
Upvote 0
Hi,

Have you tried doing a find and replace. Find com and replace with com;

Simple but should do the job.

Cheers
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top