+ Reply to Thread
Results 1 to 3 of 3

Import textfile to excel

  1. #1
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Kiruna
    Posts
    163

    Import textfile to excel

    Hi
    I have found a code that i have a little trouble to understand and i hope someone would
    be so kind and help me.

    1. This macro lets me browse and pick a text file to import.
    2. When i pick the file a dialogbox comes up an lets me enter a seperator character.
    3. When i have chosed seperator character it imports it to the workbook.

    Code:
    Please Login or Register  to view this content.
    everything works great with this but there is 3 things i need help with !

    1. My seperator character is always (space) is it possible to change that so it doesnt ask for it (so it does it by default) ?

    2. Because textfiles can get pretty large is it possible to get it to read from the last line in reverse (backwards) and stop att first free line):
    Ex text file:

    aaaa 11111 25622
    bbbb 22222 254155
    cccc 33333 356998
    dddd 44444 532256


    aaaa 11111 522546
    bbbb 22222 154123
    cccc 33333 44512
    dddd 55555 11255
    (2)
    aaaa 11111 5245454
    bbbb 22245 556t565
    cccc 33333 4454545
    dddd 55555 4545454 (1)

    Read (1) Last row to (2) Stop att first free row ?

    3. When it inserts data in the sheet it puts it in activecell, is it possible to change that to (sheet2) Column A ?

    Best regards

    Petter

  2. #2
    Forum Contributor
    Join Date
    08-27-2009
    Location
    South Africa
    MS-Off Ver
    Office 2010
    Posts
    217

    Re: Import textfile to excel !

    Hi

    Why not try something like this in your code

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Kiruna
    Posts
    163

    Re: Import textfile to excel

    wow that one works pretty great 2-3 questions solved, do you now if its possible to get the last part of the text file from last row to first free row ?

+ 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