+ Reply to Thread
Results 1 to 4 of 4

Code to export data to a .dat file

  1. #1
    Registered User
    Join Date
    10-14-2010
    Location
    Bonn, Germany
    MS-Off Ver
    Excel 2003
    Posts
    6

    Code to export data to a .dat file

    Hello All,

    I need to export data from excel to a .dat file. This DAT file is an input to another application and the exported data (the numbers) has to be in specific locations so the syntax is not disturbed . Please see attached .txt file for clarity.

    Is it possible that only the numbers are exported from excel into this file at appropriate places, if not how do I write a code in excel to export the entire data including the syntax to .txt or .dat file.


    Appreciate your help.
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Code to export data to a .dat file

    Hello aadarsh,

    Welcome to the Forum!

    Did the Excel workbook not post? You should try posting it again.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    10-14-2010
    Location
    Bonn, Germany
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Code to export data to a .dat file

    Hi,

    Please see the excel attached. The data in the blue cells needs to be exported. This is only sample data, the code needs to be scalable so that I can increase it for 22 carriers in each lane for 15 lanes.

    For scalability, there would only be new additions in Lanes. The ranges are fixed.
    Attached Files Attached Files
    Last edited by aadarsh; 10-15-2010 at 10:10 AM.

  4. #4
    Registered User
    Join Date
    10-14-2010
    Location
    Bonn, Germany
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Code to export data to a .dat file

    Hi All,

    I have found some code on internet and tried to modify it to solve my case but I have few problems.

    1. Within the code it accepts only two arrays. (See the comment in VBA editor)

    2. How do I introduce a space between the cells being exported to the txt document

    3. In the code though I specify cells F16:I19, it exports from F15:I19 instead

    Can some one help with these problems please.

    Regards,
    Adarsh

    P.S My VBA skills are very basic

+ 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