Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Data from Excel into Text File

Options
  • 18-06-2007 4:46pm
    #1
    Registered Users Posts: 1,223 ✭✭✭


    Hey, fairly new to Macros and VB so fairly lost.

    Basically, if I create a Excel file, I want it to be copied to a text file, eg. *.txt.

    Anyone have any ideas on how to do this?

    Also, when coping the info, its only 3 columns, i need it to be separated with a "~".

    Example of the line I need

    A~123456~Z

    and in Excel it appears in 3 separate columns

    A 123456 Z

    Any help or ideas would be appreciated


Comments

  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    I'm not sure if you'll be able to export it into that particular format. At best, you may be able to export it to a similar text format - Tab Delimited or CSV, then use a separate script to parse the text file and replace the delimiters with ~

    You use File > Save As... to export it to another format. Should be possible to have a Macro do that.


  • Registered Users Posts: 41 keeffe2001


    two options

    small amount of data and only doing it rarely create a fourth column to join all the previous columns together

    =CONCATENATE(A1,"~",B1,"~",C1)

    then take this column and copy it into a text file


    or you could change the regional settings in your control panel of you computer to see "~" as the list seperator and save it as a csv in excel (be sure to change it back to "," after though)


Advertisement