+ Reply to Thread
Results 1 to 6 of 6

Save each row as a separate .txt file

  1. #1
    Registered User
    Join Date
    09-07-2011
    Location
    Bangladesh
    MS-Off Ver
    Excel 2003
    Posts
    5

    Save each row as a separate .txt file

    Hey,

    I am looking for a solution to save each row of my excel sheet as a separate .txt file at ones.

    What I have:

    1. ABBANK | 10% | 1:R1 |
    2. FAS | 20% | n/a | .
    3. BDFINANCE | 35% | 2:R1 | etc..

    In this case row A is the name of the text file (e.g. ABBANK.txt) and all the other rows contain the information I would like to see in the text file.

    D:\My Documents\ABBANK.txt
    10%
    1:R1.

    D:\My Documents\FAS.txt
    20%
    n/a

    Anyone ideas?

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Save each row as a separate .txt file

    monsur2009,

    Give the following a try:
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  3. #3
    Registered User
    Join Date
    09-07-2011
    Location
    Bangladesh
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Save each row as a separate .txt file

    tigeravatar,
    Thanks for response, But show runtime error '1004' Method 'Saveas' of _worksheet failed

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Save each row as a separate .txt file

    Code ran fine for me on a test environment with no errors. The .txt files were created as intended successfully. I'm not sure where the disconnect is for you

  5. #5
    Registered User
    Join Date
    09-07-2011
    Location
    Bangladesh
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Save each row as a separate .txt file

    Thanks a Lot .. It works, But I want .txt (Windows-1252 :Western European) file and Column Heading Like as -

    Example :
    Trading code Bonus Right
    1. ABBANK | 10% | 1:R1 |
    2. FAS | 20% | n/a | .
    3. BDFINANCE | 35% | 2:R1 | etc..


    Result :

    D:\My Documents\ABBANK.txt
    Bonus : 10%
    Right : 1:R1.

    D:\My Documents\FAS.txt
    Bonus : 20%
    Right : n/a
    etc.....

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

    Re: Save each row as a separate .txt file

    Hello monsur2009,

    Welcome to the Forum!

    Do you want a text file, some thing you can read with Notepad, or a CSV file, one that is opened in Excel?
    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!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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