+ Reply to Thread
Results 1 to 5 of 5

Save each column as an individual text file

  1. #1
    Registered User
    Join Date
    02-08-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Save each column as an individual text file

    Hi all,
    First I would like to thank you all that contribute to this site, although I have only just joined I have gained so much help from it already trying to figure out my research data in excel. I only hope some of my research can help you in return one day.

    My question is:
    I have multiple columns of data, and I have to save each column as a .txt file in order to input the data into some analysis software (actimetrics clocklab).
    What would be the most time efficient way of doing this conversion to text files???
    At the moment I am copying and pasting each column into new sheet manually then saving as a text file.

    As a sub issue I also then have to add the suffix .awd to all the files to make them readable by the software, once again via slow manual means. Any ideas

    Any help would be greatly appreciated.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Save each column as an individual text file

    Try this macro

    Please Login or Register  to view this content.
    Open up the VBA editor by hitting ALT F11

    Insert a new module by hitting Insert - Module

    Paste the macro into the empty sheet

    Hit ALT F11 to get back to the worksheet.

    Run the macro by going to tools-macro in Excel 2003 or the view ribbon in Excel 2007/2010.

    I've assumed that the file names will be taken from row 1 and the block of data has no empty columns within it.
    Martin

  3. #3
    Registered User
    Join Date
    02-08-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Save each column as an individual text file

    Thank you Martin for your prompt reply.
    I haven't been able to get it working yet, when I try to run the macro I get "runtime error 76, path not found"
    Do you have any suggestions. Great idea on the cancer research request

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Save each column as an individual text file

    Couple of possibilities...

    Have you got a c:\temp folder - if not adjust the code to a folder that you do have.

    Do your values in row one contain slash or other characters that are not normally allowed in file names?

    If you are still having problems, suggest that you post some sample data as an attachment.

  5. #5
    Registered User
    Join Date
    02-08-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Save each column as an individual text file

    Yep, it was the temp folder problem.
    Thank you for explaining everything so clearly for some one with little excel knowledge it is much appreciated.
    Thank you Martin, have a great day.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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