+ Reply to Thread
Results 1 to 8 of 8

How can I save each row of a spreadsheet as separate text files?

  1. #1
    Registered User
    Join Date
    08-11-2020
    Location
    NY, USA
    MS-Off Ver
    365
    Posts
    6

    Question How can I save each row of a spreadsheet as separate text files?

    I would really really appreciate some help here!!
    I have a spreadsheet with >4000 rows, where each row has 2 columns. I want to save each row as a separate text file. How can I do that?
    An example of the structure of the data:

    ID (number) Report (text)
    1645 Today is a beautiful day...
    1967 Today the sun is shinning
    2389 Today is a rainy day...

    I need separate txt files containing each report and hopefully each file under the name of the respective ID.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: How can I save each row of a spreadsheet as separate text files?

    Please do not post duplicate threads - I have closed the other 2
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: How can I save each row of a spreadsheet as separate text files?

    .
    https://superuser.com/questions/3871...ther-cell-data

  4. #4
    Registered User
    Join Date
    08-11-2020
    Location
    NY, USA
    MS-Off Ver
    365
    Posts
    6

    Re: How can I save each row of a spreadsheet as separate text files?

    Sorry for the multiple threads, I am a new member here.
    Thanks for the link.
    Unfortunately, that didn't work.

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: How can I save each row of a spreadsheet as separate text files?

    .
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-11-2020
    Location
    NY, USA
    MS-Off Ver
    365
    Posts
    6

    Re: How can I save each row of a spreadsheet as separate text files?

    Thank you so much!!
    What would I have to change if I want the content of the file to be only the second column? (i.e. the first column is used just for the file names)

    is it:
    fileOut.write Cells(i, 2)

    instead of:
    fileOut.write Cells(i, 1) & " " & Cells(i, 2)

    ???
    Last edited by maxim545; 08-11-2020 at 04:54 PM.

  7. #7
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: How can I save each row of a spreadsheet as separate text files?

    .
    Change : fileOut.write Cells(i, 1) & " " & Cells(i, 2)

    To: fileOut.write Cells(i, 2)

  8. #8
    Registered User
    Join Date
    08-11-2020
    Location
    NY, USA
    MS-Off Ver
    365
    Posts
    6

    Re: How can I save each row of a spreadsheet as separate text files?

    )
    Thank you very much!!!

+ 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. How can I save each row of a spreadsheet as separate text files?
    By maxim545 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-11-2020, 03:48 PM
  2. [SOLVED] Save the Output in Separate CSV Files
    By aashishni in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-20-2018, 03:53 PM
  3. [SOLVED] save all sheets as separate text files
    By Minnesaenger in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-06-2015, 02:25 AM
  4. [SOLVED] Divide worsheet and save as separate files
    By Colin Hayes in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 07:05 AM
  5. Divide worsheet and save as separate files
    By Colin Hayes in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 AM
  6. Divide worsheet and save as separate files
    By Colin Hayes in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  7. [SOLVED] Divide worsheet and save as separate files
    By Colin Hayes in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-28-2005, 05:05 PM

Tags for this Thread

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