Delete all text in a sheet except e-mail addresses for MailChimp purposes

MajidAl

New Member
Joined
Mar 24, 2017
Messages
15
Hi all,

Does anybody here know whether it's possible to run some kind of script or macro to delete all text in an excel sheet except for the e-mail addresses in it? I have exported a mailing list from MailChimp, but I can't import it anymore, because the export made a very messy file. This is an example of what I have.

Code:
<style><!--table    {mso-displayed-decimal-separator:"\,";    mso-displayed-thousand-separator:"\.";}@page    {margin:.75in .7in .75in .7in;    mso-header-margin:.3in;    mso-footer-margin:.3in;}td    {padding-top:1px;    padding-right:1px;    padding-left:1px;    mso-ignore:padding;    color:black;    font-size:12.0pt;    font-weight:400;    font-style:normal;    text-decoration:none;    font-family:Calibri, sans-serif;    mso-font-charset:0;    mso-number-format:General;    text-align:general;    vertical-align:bottom;    border:none;    mso-background-source:auto;    mso-pattern:auto;    mso-protection:locked visible;    white-space:nowrap;    mso-rotate:0;}--></style>[TABLE="width: 87"]
<tbody>[TR]
[TD="width: 87"]First Name,"Last  Name","Email  Address",MEMBER_RATING,OPTIN_TIME,OPTIN_IP,CONFIRM_TIME,CONFIRM_IP,LATITUDE,LONGITUDE,GMTOFF,DSTOFF,TIMEZONE,CC,REGION,LAST_CHANGED,LEID,EUID,NOTES[/TD]
[/TR]
[TR]
[TD],,jp_55@hotmail.co.uk,2,,,"2016-08-23  08:03:14",185.92.223.204,,,,,,,,"2016-08-23  08:03:14",114852441,41260214da,[/TD]
[/TR]
[TR]
[TD],,Rucksana4567@gmail.com,2,,,"2016-08-27  13:43:09",185.92.223.204,,,,,,,,"2016-08-27  13:43:09",114951541,126badcb6b,[/TD]
[/TR]
[TR]
[TD],,amaanh68@gmail.com,2,,,"2016-08-28  08:03:49",185.92.223.204,,,,,,,,"2016-08-28  08:03:49",114954829,982835bc1a,[/TD]
[/TR]
</tbody>[/TABLE]

So what I want, is to delete ALL the text except for the mail addresses. Does anybody know if this is possible? I'm using Excel on a Macbook Pro.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi Majid,

You have the sample data in in one cell or in different rows in your workbook?


Regards,
DILIPandey
 
Upvote 0
Dear Dilipandey,

All the data is in 1 column in different cells. So for every e-mail adress, there is only 1 long cell and 1 column.
 
Upvote 0
Okay.. with your sample data in cells A1 to A4, use below formula in cell B1 and drag down:-


=IFERROR(SUBSTITUTE(MID(SUBSTITUTE(A1,",",REPT("~",99)),SEARCH("@",SUBSTITUTE(A1,",",REPT("~",99)))-50,90),"~",""),"")


Regards,
DILIPandey
 
Upvote 0
Dear DiliPandey,

Thank you for the quick answer. Unfortunately, I'm not very good with Excel.. So I don't know how to execute the formula properly. Beneath you can see how my Excel file looks like. It consists of 3.163 rows in total..

Schermafbeelding_2017-03-25_om_15.11.23.png


Thanks in advance for the quick answers and help!



Okay.. with your sample data in cells A1 to A4, use below formula in cell B1 and drag down:-


=IFERROR(SUBSTITUTE(MID(SUBSTITUTE(A1,",",REPT("~",99)),SEARCH("@",SUBSTITUTE(A1,",",REPT("~",99)))-50,90),"~",""),"")


Regards,
DILIPandey
 
Upvote 0
For me, it is working fine.


Can you upload your fine over a public sharing portal like dropbox and provide the link here ?


Regards,
DILIPandey
 
Upvote 0
That's weird.. I've uploaded the file for you on Dropbox and sent you a link, thank you very much!
 
Upvote 0
Beneath you can see how my Excel file looks like.
For that same sample that you showed, could you show another image of what the result should look like?

I've uploaded the file for you on Dropbox and sent you a link
Any links should be provided here in the public forum, not privately. Please refer to #4 of the Forum Rules
 
Upvote 0

Forum statistics

Threads
1,214,385
Messages
6,119,210
Members
448,874
Latest member
b1step2far

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