+ Reply to Thread
Results 1 to 13 of 13

Creating a Macros to save individual columns as text files

  1. #1
    Registered User
    Join Date
    08-13-2012
    Location
    West Lafayette, Indiana
    MS-Off Ver
    Excel 2007
    Posts
    15

    Creating a Macros to save individual columns as text files

    Hi,

    I have a spread sheet with 759 columns, I'm trying to figure out if there is a way to save each column as a seperate text file (with different names, ie. text1, text2, text3, etc) without doing each seperately. I'm new to using macros, but am hoping it can solve my problem! Any help is appreciated! Thanks!

    Lori

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Creating a Macros to save individual columns as text files

    Can you upload a copy of the file? is the export of the files to be Tab dilemited or comma. 1 line or multiple?
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    08-13-2012
    Location
    West Lafayette, Indiana
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Creating a Macros to save individual columns as text files

    Each column has 31 rows and it should be tab dilemited; I'd like to have them saved as "rain1", "rain2", etc. I've attached the spreadsheet
    Attached Files Attached Files

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Creating a Macros to save individual columns as text files

    So it will be one Line
    Ex: 0.01622326 "Tab" 0.01622311 "Tab" ect...

  5. #5
    Registered User
    Join Date
    08-13-2012
    Location
    West Lafayette, Indiana
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Creating a Macros to save individual columns as text files

    Actually, I'd prefer it to stay in column format if that's possible.
    EX:
    0.01622326
    0.01622311
    .
    .
    .
    .
    etc

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Creating a Macros to save individual columns as text files

    See if this will work

    Please Login or Register  to view this content.

  7. #7
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Creating a Macros to save individual columns as text files

    Try this

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    08-13-2012
    Location
    West Lafayette, Indiana
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Creating a Macros to save individual columns as text files

    Works perfectly! Thank you so much!

    ---------- Post added at 10:19 AM ---------- Previous post was at 10:11 AM ----------

    So I also have the same kind of situation, but this time I want to save 2 columns at a time, seperated by commas...
    EX:
    23.4345, 19.9837
    24.5684, 17.3947
    23.9483, 16.8374
    .
    .
    .
    etc

    is there an easy way to manipulate this same code?
    Thanks again!

  9. #9
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Creating a Macros to save individual columns as text files

    Are the columns next to each other?

    ---------- Post added at 10:29 AM ---------- Previous post was at 10:25 AM ----------

    is it in the same format as the workbook you uploaded? Are you wanting to just export 2 columns only, making one file?

  10. #10
    Registered User
    Join Date
    08-13-2012
    Location
    West Lafayette, Indiana
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Creating a Macros to save individual columns as text files

    yes, exactly same format. Now there are 1518 columns total and I want to save the first two columns together, then the next two, etc.

  11. #11
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Creating a Macros to save individual columns as text files

    Maybe this will do what you want

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    08-13-2012
    Location
    West Lafayette, Indiana
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Creating a Macros to save individual columns as text files

    yes! with a small alteration to the numbering of the files, it works like a charm! thank you so much for all your help!

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    08-13-2012
    Location
    West Lafayette, Indiana
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Creating a Macros to save individual columns as text files

    or also

    Please Login or Register  to view this content.

+ 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