+ Reply to Thread
Results 1 to 6 of 6

How would I save excel data to an existing .txt file

  1. #1
    Registered User
    Join Date
    01-02-2015
    Location
    Left of center
    MS-Off Ver
    2010
    Posts
    3

    How would I save excel data to an existing .txt file

    I need to take data from a simple spreadsheet and save it to an existing .txt file. I have tried but It always over writes the data that was there before. Below is the spreadsheet



    I need to be able to Click on the "C" in the last column which will select that one row (example Line 4) and save the data in each cell and copy it to my text file in the same folder. The text will look something like this. (The data is a screenshot from another try that is why it doesn't match, just in case you were wondering lol)


    I also need the last cell to read the numerical value. Is there a macro code that can do this? Like I said I cannot get it to save to a following line in the text file. It just over writes the last save line of text. This has been driving my noob brain crazy. I would appreciate any help you can share. Thank you for your time.

    Sir Dude

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: How would I save excel data to an existing .txt file

    Sir Dude,

    Welcome to the forum.

    Many of us do not have the capability of seeing *.png files....me included. Also it is helpful if you can upload a small sample Excel workbook file that illustrates your question with sensitive data removed. It saves us having to retype your data.

    Regards,
    FR

  3. #3
    Registered User
    Join Date
    01-02-2015
    Location
    Left of center
    MS-Off Ver
    2010
    Posts
    3

    Re: How would I save excel data to an existing .txt file

    Sorry, I did not know. I attached the 2 files that I am using. The Spreadsheet and .txt file
    Attached Files Attached Files
    Last edited by Sir Dude; 02-13-2015 at 09:55 PM.

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: How would I save excel data to an existing .txt file

    The macro attached to the C in column T doesn't copy the row, it clears it. If you select from A4:Q4 and copy then go to the TXT file you can paste the values at the end of the file without problem.

    I recorded a macro and created a button for it to select the row and copy it....this is what you need for the rest of the rows.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: How would I save excel data to an existing .txt file

    If I understand correctly you are wanting to append new data to an existing text file using a macro.

    Unfortunately I do not know how to do this in VBA. Stay with your thread.....somebody knows. The remaining question @ reading the numeric value and what to do with it might also be settled then, too.

    Sorry I couldn't help.

  6. #6
    Registered User
    Join Date
    01-02-2015
    Location
    Left of center
    MS-Off Ver
    2010
    Posts
    3

    Re: How would I save excel data to an existing .txt file

    Quote Originally Posted by newdoverman View Post
    The macro attached to the C in column T doesn't copy the row, it clears it. If you select from A4:Q4 and copy then go to the TXT file you can paste the values at the end of the file without problem.

    I recorded a macro and created a button for it to select the row and copy it....this is what you need for the rest of the rows.
    Yes, I know. I was going to add that function. I know how to to make that function it is the copying the text to an existing .txt file. To keep as a log file. I can copy the data, but it copies over existing data so I lose what I had before. I was going to make it a multi function button. I was going to have it
    1. Copy the data from the row.
    2. Open a .txt file then paste the data to the text file below existing data then save, and close the .txt file.
    3.Then it was going to clear the row.

    Then the sort button above moves everything up in order.

    If I add columns it messes with other macros I have in place. Thank you for trying tho. I appreciate your time.
    Last edited by Sir Dude; 02-13-2015 at 10:13 PM.

+ 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. vba to save file as a new file and record data into existing data sheet
    By lazyserv in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-29-2014, 08:24 AM
  2. Save As-Overwrite existing File
    By loulorisgomez in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2012, 07:24 AM
  3. Force Save over existing file
    By XCESIV in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-25-2006, 03:55 AM
  4. [SOLVED] can i save an existing .xls file as a .csv file using command line
    By craigkan in forum Excel General
    Replies: 2
    Last Post: 02-18-2005, 10:06 AM
  5. Automatically Replacing existing file on save
    By windsurferLA in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-05-2005, 02: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