+ Reply to Thread
Results 1 to 15 of 15

Create txt file from excel sheet

  1. #1
    Forum Contributor
    Join Date
    12-21-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    398

    Create txt file from excel sheet

    I am a beginner in excel macro, and hope to find an answer to my question in this great forum.
    I want to create APRIL.txt file from the data in my spreadsheet.

    The sample Sheet is attached here with.
    Attached Files Attached Files
    My English is very poor, so please be patient >_<"

    Thanks & Regards.
    hkbhansali

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Create txt file from excel sheet

    If I may ask, what is the complication about this? I mean, if it's me I would just copy that and paste into a notepad and save.
    多么想要告诉你 我好喜欢你

  3. #3
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Create txt file from excel sheet

    This question's been asked a few times recently - so I've written a quick post to cover it:

    http://excel.solutions/2014/04/using...-to-text-file/
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  4. #4
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Create txt file from excel sheet

    Here's another..
    Change file path to suit..
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    12-21-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    398

    Re: Create txt file from excel sheet

    yaa, it s work,

    Thanks a lot all above my welwisher,

  6. #6
    Forum Contributor
    Join Date
    12-21-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    398

    Re: Create txt file from excel sheet

    Hi apo,
    will u add code if any row in a column A is mark "X" can skip in above code?

  7. #7
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Create txt file from excel sheet

    You can easily adapt my code to do that - see highlights in red:
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    12-21-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    398

    Re: Create txt file from excel sheet

    Hi olly,

    Thanks for prompt reply,
    its work fine,

  9. #9
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Create txt file from excel sheet

    Hi..
    Given that all your data is in 1 column.. this should do..

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    12-21-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    398

    Re: Create txt file from excel sheet

    Hi, apo
    u r right my data is in 1 column only and its "B" column,
    above code is not working.

  11. #11
    Forum Contributor
    Join Date
    12-21-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    398

    Re: Create txt file from excel sheet

    hi olly,
    your code is perfect but its generate all column while i want only column "B" data only

  12. #12
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Create txt file from excel sheet

    Quote Originally Posted by hkbhansali View Post
    hi olly,
    your code is perfect but its generate all column while i want only column "B" data only
    Come on, you need to start understanding and tweaking the code to suit your workbook.

    Change the line highlighted in blue, to the range you actually want this to apply to:
    Please Login or Register  to view this content.
    So in your case, you may change this to something like:
    Please Login or Register  to view this content.

  13. #13
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Create txt file from excel sheet

    Olly is right.. you should step through any code given to you in order to understand what it does.. and at least attempt to reverse engineer it..

    Minor changes that were needed in my code are shown in red..

    Please Login or Register  to view this content.

  14. #14
    Forum Contributor
    Join Date
    12-21-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    398

    Re: Create txt file from excel sheet

    Hi,olly, & apo
    THANKS,
    my problem solved, thanks for kind help.

  15. #15
    Forum Contributor
    Join Date
    12-21-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    398

    Re: Create txt file from excel sheet

    Hi,olly, & apo
    THANKS,
    my problem solved, thanks for kind help.

+ 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] One Report, create multiple sheets, save each sheet in a seperate excel file
    By sammymalta in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-04-2013, 07:12 AM
  2. Create a *.txt file from an excel sheet
    By Woodbags in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-07-2013, 08:36 AM
  3. Filter, copy filtered data into another sheet, create a file of that sheet..
    By titushanke in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-17-2012, 02:26 PM
  4. Replies: 3
    Last Post: 09-30-2011, 04:35 AM
  5. [Macro excel] How to create and export a sheet into a *.inp (or *.txt) file
    By MrKermit in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2006, 03:30 AM

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