+ Reply to Thread
Results 1 to 7 of 7

Export to txt

  1. #1
    Forum Contributor
    Join Date
    03-03-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    123

    Export to txt

    Hi there,

    I am looking for a code that I can use to export a range of cells to a txt file, and place it on the desktop
    I also want it to skip the rows where col D have "0"
    The range is D9:M121
    The file name must be the value from Cell E3

    Thanks in advance,

    Jakes

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: Export to txt

    Please Login or Register  to view this content.
    David
    (*) Reputation points appreciated.

  3. #3
    Forum Contributor
    Join Date
    03-03-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    123

    Re: Export to txt

    Hi David,

    Thank you for the code , I just have one error, and it could be my fault. I have double checked the path, even set it to just C drive, but I keep get a error on this part:

    Please Login or Register  to view this content.
    My path is
    Please Login or Register  to view this content.
    The error message is:
    Run-time error 75
    Path/File access error

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: Export to txt

    Put this just before the Open line.
    Please Login or Register  to view this content.
    Step through the code (F8) and after you execute this line, look in the immediate window and see what path it output. Does the output look like a valid path/filename?

  5. #5
    Forum Contributor
    Join Date
    03-03-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    123

    Re: Export to txt

    Ahh just a simple fault on my side. My apologies, and thanks for the help!

  6. #6
    Forum Contributor
    Join Date
    03-03-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    123

    Re: Export to txt

    BTW how can I change the code so teh user can choose where to save the file?

  7. #7
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: Export to txt

    Please Login or Register  to view this content.
    Last edited by Tinbendr; 09-12-2012 at 12:29 PM.

+ 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