+ Reply to Thread
Results 1 to 4 of 4

Create individual text files from multiple rows

  1. #1
    Registered User
    Join Date
    07-07-2017
    Location
    Dorking, England
    MS-Off Ver
    2010
    Posts
    2

    Create individual text files from multiple rows

    Hi all. I'm new to the forum today, and I have already found the extremely helpful macro for creating individual text files from multiple rows in excel where col A becomes the file name.

    I now want to go a bit further, by creating a text file with multiple rows from a single row in excel.

    For example, I have a row in excel that reads:
    A B C D E F G
    list1 address1 41 beech avenue address2 35 grove avenue address3 99 oak road


    and I want to create a text file named "list1" where the contents are set out as:
    address1 41 beech avenue
    address2 35 grove avenue
    address3 99 oak road

    Can anyone help me on this please?

    Many thanks,

    cagey1953

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Create individual text files from multiple rows

    Hello Cagey1953,

    Welcome to the forum!

    This macro will create the individual text files from each row of the ActiveSheet. The firstcell is assumed to be "A1". You can change this if you need to.

    Since you did not say where the files are to be stored, you will probably have to change the variable FilePath in the macro to the folder you will be using.

    The rows are parsed 2 columns at a time. One column is for "List" and the other is for the "Address". Each row is assumed to have a variable number of addresses. The macro finds the end of each row, parses the data, and outputs that to new file.

    Copy the code and paste it into a new VBA Module in your workbook.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    07-07-2017
    Location
    Dorking, England
    MS-Off Ver
    2010
    Posts
    2

    Re: Create individual text files from multiple rows

    Hi Leith. Works a treat. Thanks very much.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Create individual text files from multiple rows

    Hello cagey1953,

    Your welcome. Brilliant, I am glad you got it to run with no problems.

+ 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. [SOLVED] Extract data from multiple text files into individual columns
    By JonnyEnglish in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-11-2017, 09:19 AM
  2. Export Individual Rows To Individual Text Files?
    By jimmer18 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-13-2014, 11:43 AM
  3. Help importing multiple text files into individual columns
    By Jev1991 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-10-2013, 11:37 AM
  4. [SOLVED] Exporting filled rows into individual text files
    By mockingjay3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-21-2013, 05:34 AM
  5. reducing files: multiple rows per individual
    By zoltan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-24-2011, 05:30 PM
  6. Help importing multiple text files to individual sheets in an excel workbook
    By cham.miller in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-13-2010, 06:55 PM
  7. importing multiple text files into individual worksheets in workbook
    By glepage@execulink.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2006, 01:35 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