+ Reply to Thread
Results 1 to 5 of 5

Import space delimited text file into excel

  1. #1
    Forum Contributor vijay2482's Avatar
    Join Date
    03-03-2009
    Location
    Paris,France
    MS-Off Ver
    Excel 2003
    Posts
    263

    Import space delimited text file into excel

    Hi all,

    I have a text file with 2 fields.
    The 2 fields are space delimited.

    I have the below code from google search,
    It does not write the 2 fields into 2 columns.
    Have attached the excel workbook and a sample file.
    Please Login or Register  to view this content.
    Some help on the above please.
    Thanks.
    Attached Files Attached Files
    VIjay

    If you find any of the post useful to your question, please add to the contributor's reputation by clicking the blue scales icon in the blue bar of the post.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Import space delimited text file into excel

    If I read your macro correctly, you select a cell on your sheet manually, then run the macro and it's supposed to load the 2-column text file into your sheet at that point. If so, try this alternate method:

    Please Login or Register  to view this content.
    If you would rather explain the logic on how the macro might be able to find the proper place to insert the text without you having to manually select a cell first, do so and we can suggest a targeting method, too. For instance...first empty cell in column A.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor vijay2482's Avatar
    Join Date
    03-03-2009
    Location
    Paris,France
    MS-Off Ver
    Excel 2003
    Posts
    263

    Re: Import space delimited text file into excel

    Thanks for your responce.

    I would liketo insert in the first cell of A, the first field and the second field in first cell of B.
    I would also like to add a new sheet called Drawings and insert the value there.
    Have not executed your code.
    will give it a try and let you know.
    Thanks

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Import space delimited text file into excel

    Quote Originally Posted by vijay2482 View Post
    I would like to insert in the first cell of A, the first field and the second field in first cell of B.
    Then change the Destination code to read like so:
    Please Login or Register  to view this content.
    I would also like to add a new sheet called Drawings and insert the value there.
    Please explain further. Is this in addition to above, a second insertion? Or is it instead of?

    Does the "Drawings" sheet already exist? If not, should the macro create it? If it does exist, insert the data where?
    Have not executed your code.
    will give it a try and let you know.
    Thanks[/QUOTE]

  5. #5
    Forum Contributor vijay2482's Avatar
    Join Date
    03-03-2009
    Location
    Paris,France
    MS-Off Ver
    Excel 2003
    Posts
    263

    Re: Import space delimited text file into excel

    Please explain further. Is this in addition to above, a second insertion? Or is it instead of?

    Does the "Drawings" sheet already exist? If not, should the macro create it? If it does exist, insert the data where?
    The above code will be written in a module.
    When the macro is run, it has to create a new sheet named drawings and the data has to be inserted in that sheet.
    The drawings sheet will not be available already.

+ 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