+ Reply to Thread
Results 1 to 6 of 6

Help Really needed. Export excel to text file.

  1. #1
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Help Really needed. Export excel to text file.

    Hi i have a big problem i have been fighting with. In my job i will get a file which i will put in excel to work and edit in it.
    After i have make the edit, i have to export it to a text file, seperated with semicolon.
    I have 2 macros which can do that and its working really good.
    Macro3 open a filedialog, where i can choose where to save and after a dialogbox, how i want to seperate(semicolon or eks comma)
    Macro1 do the same, but save to a file called output.txt
    Both macro are working perfect.
    My problem is on one of the columns(column E, only numbers), i need to delete the first 2 zeros, before i export to the textfile.
    I have tried many things,i can easily delete the first 2 zeros example with custom format and put 000000000000. But
    whatever i do, when i export the file it delete the zeros in the textfile. I can only keep the zeros if i format the column to text before
    i put the numbers in. But in this case if i edit, it give me the same result(remove the zeroes)
    I have attached a test sheet, you can play with. the numbers in column E are pasted in, after formet to text.
    I would prefer a macro for this to change it in column E, either in one of the existing macroes, or in a seperate macro.
    But all solutions will be appriciated, it really give me problems. And i really need this solution.

    Hope for some help here.

    ps. Use excel 2003

    Thanks in advance
    Sincerly Abjac
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Help Really needed. Export excel to text file.

    Maybe i can't help you enough with your problem.

    For me it's not clear what you want to achieve.

    The data in column E are in the sheet (or you paste them manualy?).

    Maybe you can show in your file, the before and after situation.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Help Really needed. Export excel to text file.

    HI Oeldere.
    I paste the numbers in to column E manually. Have format column E before to text so it keep the zeroes.
    And then i want to delete the first 2 zeros.
    After delete them i want to export to textfile(seperated with simicolon), but what ever i do it delete all zeroes in the textfile. It have to keep the existing zeros, after i
    either use macro 3 or macro 1, they both work good.
    See output textfile. I can export and keep all zeroes. But only if column is in text. But i need a way to delete the first 2 zero in excel, before export. But still keep the other zeroes.
    See below file.

    Hope you or other can solve this one

    Thanks in advance
    Abjac
    Attached Files Attached Files

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Help Really needed. Export excel to text file.

    See if this modification to eport2csv helps

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  5. #5
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Help Really needed. Export excel to text file.

    HI Mike. Thanks for what for me is a peace or Art haha. Its working really good. Have some few questions. If i want it to be another column than E and not the last used column. How can i change that, so it only take the specific column. I dont know yet which column the output(for removing the 2 zeros) have to be in, but for sure it have to be in a certain column. Its for integration in SAP. So really important for me to be ready for it.
    So would be nice if you can explain how i can make this to another column. And if you have energy to it, would be nice if you can integrate this in macro3 which have the obtion to select file for save and also put in the seperator manually.

    Please have a look, but this is working if i format column to text before i paste the numbers in, which if fine. But need to be sure i can change the column to another and and it can be a column, which are in the middle of the used columns.

    Please have a look Mike

    Thanks in advance

    SIncerely

    Abjac

  6. #6
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Help Really needed. Export excel to text file.

    Hi I found it my self and its working now. Thanks for your help Mike and Oeldera.

    This one i can change the amount of numbers and it keep the zeroes infront. I just need to format the column to text before i paste the numbers in. But its fine and working.

    working code.New one

    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)

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