+ Reply to Thread
Results 1 to 11 of 11

Need Export Macro to text file based on email address

  1. #1
    Registered User
    Join Date
    12-17-2013
    Location
    22899249
    MS-Off Ver
    Excel 2010
    Posts
    6

    Need Export Macro to text file based on email address

    First off, completely brand new to all of this. I have been given the task at work to break down a csv file that is a dump of multiple users address books, and sorts them out according to the owner of the address books email addresses. What I'm looking to do is create a macro that would be able to distinguish a change in email address, and make a new file when it notices the change. Example:

    A B
    [email protected] Data
    [email protected] Data
    [email protected] Data
    [email protected] Data
    [email protected] Data


    Ideally, I would like to create a file with the [email protected] rows only in one file, followed by [email protected] in another file, using the same macro if possible. Also, I'd like to try to name the newly created txt file the name of the email address in column A Not sure if this is even something that can be done, but I figured I'd take the shot considering the Excel file I have has over 300 address books and 6000 columns. I have been researching this for over the past 24 hours, and figured I'd finally wave the white flag and ask for help to see if it's even possible. Thanks in advance for any advice or suggestions!

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Need Export Macro to text file based on email address

    Here is a macro that will copy data to a sheet and save that sheet to a txt file. I added the .txt entension for your computer to be able to open it but you can get rid of it if you want. First part of the file name will be the email address.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Registered User
    Join Date
    12-17-2013
    Location
    22899249
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need Export Macro to text file based on email address

    This is fantastic. Thank you so much!!!! It worked great on the example file you had. This is what the file looks like that I have. I have already consolidated all of the address book data into column A. So it looks like this;

    [email protected] Rose|Rose|Last Name|[email protected]|
    [email protected] John|John|Doe|[email protected]|
    [email protected] Jane|Jane|Doe|[email protected]|

    Each address book entry is an individual row in the workbook. Some only have one, some have 50+
    This format of Column B is exactly what I need to be dumped into the text file as is. This will allow my import of the address books to be seamless. I really appreciate your help. I thought this was a lost cause, you are awesome!

  4. #4
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Need Export Macro to text file based on email address

    Do you need some more help about this thread or you'll be able to make it run for your real data?

  5. #5
    Registered User
    Join Date
    12-17-2013
    Location
    22899249
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need Export Macro to text file based on email address

    I'm trying to figure it out right now, but I feel like I'm breaking more then I'm fixing. If you have time to help, I would love it. If not I'll continue to grind away and see if I can figure out how to get this to do what I want.

  6. #6
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Need Export Macro to text file based on email address

    Attach a sample file so i can work with your real data set up.

  7. #7
    Registered User
    Join Date
    12-17-2013
    Location
    22899249
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need Export Macro to text file based on email address

    Sample.xlsx


    Here is a snippet

  8. #8
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Need Export Macro to text file based on email address

    Looks like all data you want to transfer in the text file is in column B. Am I right?
    It is time to go to bed here so I will look at this tomorrow. Sorry for the delay.

  9. #9
    Registered User
    Join Date
    12-17-2013
    Location
    22899249
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need Export Macro to text file based on email address

    That's correct. I'd like it to stay in the exact format that it's in for column B. Thanks for all of your help!

  10. #10
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Need Export Macro to text file based on email address

    attached file should work just fine.
    There were some errors in my previous program so here is the revised macro:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    12-17-2013
    Location
    22899249
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need Export Macro to text file based on email address

    You have made this a very Merry Christmas for myself. I thought this would take up the next week or two sorting through this. I cannot begin to thank you enough. I hope you and your family have a Happy Holidays and thanks again!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 11
    Last Post: 05-26-2013, 07:45 AM
  2. [SOLVED] text based file import, database populate and then export.
    By R2dical in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-27-2013, 06:12 PM
  3. Replies: 0
    Last Post: 02-21-2013, 04:46 AM
  4. Need VB Code to Extract email address from File name and email the file
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-30-2012, 11:18 AM
  5. Macro to move word document based on email address
    By kingsley in forum Excel General
    Replies: 0
    Last Post: 10-03-2011, 02:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1