+ Reply to Thread
Results 1 to 5 of 5

Export cell value to txt file

  1. #1
    Registered User
    Join Date
    08-22-2014
    Location
    Asten
    MS-Off Ver
    2007
    Posts
    3

    Post Export cell value to txt file

    Hi guys,

    I need a macro that exports cells A1, A2 and A3 to a text file in the current dir whit the current parent folder name.
    For examlpe; My *xslm is located in "C:\tekeningen\Parts\Test\15-A9999". The txt file should be named 15-A9999.txt and saverd in folder 15-A9999.

    The that i use puts the file in folder "test"

    Thanks in advance!

    Sub Create_TXT_PAD()

    Dim c As Range, R As Range
    Dim output As String
    For Each R In Range("A1:C3").Rows
    For Each c In R.Cells
    output = output & c.Value
    Next c
    output = output & vbNewLine
    Next R
    Open ThisWorkbook.Path & ".txt" For Output As #1
    Print #1, output
    Close
    End Sub

  2. #2
    Forum Contributor
    Join Date
    01-14-2014
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    240

    Re: Export cell value to txt file

    Please Login or Register  to view this content.
    Please consider adding a * if I helped.

  3. #3
    Registered User
    Join Date
    08-22-2014
    Location
    Asten
    MS-Off Ver
    2007
    Posts
    3

    Re: Export cell value to txt file

    Thank you for your help!

  4. #4
    Forum Contributor
    Join Date
    01-14-2014
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    240

    Re: Export cell value to txt file

    Sounds like you are happy this is solved? If so please can you mark the thread solved.

    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

    If I helped consider adding some * reps.

    Regards

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

    Re: Export cell value to txt file

    Here's another..

    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)

Similar Threads

  1. export cell content onto notepad file
    By birdboyee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-24-2014, 09:59 PM
  2. Export each row as text file using first cell in row as title
    By aaronmb in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-11-2013, 06:40 AM
  3. Export cell to txt file
    By monkeychops in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-12-2008, 01:31 PM
  4. [SOLVED] Cell export to Text File?
    By Steve in forum Excel General
    Replies: 3
    Last Post: 12-07-2005, 11:15 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