+ Reply to Thread
Results 1 to 6 of 6

VB Code to copy data from excel to text file

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code to copy data from excel to text file

    Hello:

    Please refer to attached file.
    I have data in column C row 5 down.
    I need a VB Code to copy the data from C5 down and save as .txt file in C:\Temp\ with file name in cell C3.
    Sample Oct15.txt file is also attached.
    Let me know if you have any questions.
    Thanks.
    RM
    Attached Files Attached Files
    Last edited by rizmomin; 11-20-2015 at 03:44 PM.

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VB Code to copy data from excel to text file

    Maybe :

    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: VB Code to copy data from excel to text file

    Try
    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to copy data from excel to text file

    Hi Guys:

    Jindon your solution works for me great....Thanks.
    Karedog, for some reason your solution does not copy value as it gives #REF in the txt file.
    Anyway, i would like to thank both of you for great help.
    Thanks
    Riz

  5. #5
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VB Code to copy data from excel to text file

    It means that you don't work with your original file, but using different layout which has formula on the cells.

    Please Login or Register  to view this content.

    And also, be noticed that if you use jindon's method, all the formatting will be lost, for example number set as certain decimal points, time format, unicode characters, etc. Look at the attachment to see it.


    Thanks for the reps.


    Regards
    Attached Files Attached Files
    Last edited by karedog; 11-21-2015 at 12:23 PM.

  6. #6
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to copy data from excel to text file

    Hi karedog:

    Thanks for providing the great info and help..
    RM

+ 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. Macto to copy words from text file to excel
    By maor.wn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-07-2013, 02:51 AM
  2. Looking for Excel file which can copy two text file in two diffrent spreadsheet
    By mobile_guru in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-02-2012, 09:28 PM
  3. Copy Excel to Text file and pass Text file to Access Table
    By robbie_xcell in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-27-2011, 01:53 PM
  4. Copy text file into Excel
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-17-2010, 04:02 PM
  5. looping, Open text file, copy text, close text file
    By jwilds1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2009, 05:12 PM
  6. Get macro to copy one row from excel to a text file. Possible?
    By bjorn007 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-11-2005, 12:05 PM
  7. Re: Get macro to copy one row from excel to a text file. Possible?
    By Bernie Deitrick in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2005, 02:07 PM
  8. [SOLVED] How do I copy a Word text file into Excel in a way that each char.
    By Newtech programmer in forum Excel General
    Replies: 2
    Last Post: 04-15-2005, 03:06 PM

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