+ Reply to Thread
Results 1 to 4 of 4

Copying certain text in textfile and paste into excel

  1. #1
    Registered User
    Join Date
    11-26-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Copying certain text in textfile and paste into excel

    Hello Guys...I need help here

    I have a textfile and i'm using vba for excel to read the textline and paste in into excel..
    I have a textfile that contain a thousand of data
    the purpose of this project is to copy the textline from the starting text that i choose until it reach the end that i also choose..

    here, i have attached a sample textfile that i need to copy to the excel...

    fyi, A73, Z1 and A74 F+ is the node number..
    For example i want to read A73 until node Z1 only, and my first node is A73, and the last node is Z1
    I want it to read the all the textline until it reach the GRT1P1+U8+W8 line of Z1...
    My problem is how do i do that...

    FYI also, i have thousands of node number..This is just a sample..

    Regards...
    Attached Files Attached Files
    Last edited by djmal; 12-08-2010 at 05:09 AM.

  2. #2
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    729

    Re: Copying certain text in textfile and paste into excel

    hi friend,
    why don't you open this text file in excel?
    if you open it in excel then you can easily make a loop.

  3. #3
    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: Copying certain text in textfile and paste into excel

    Hello djmal,

    This macro will parse the data from the starting node to the ending node and copy it to the ActiveSheet starting in cell "A1". Be sure to change the variables StartNode, EndNode, and the FileSpec to what you need.

    Macro Code
    Please Login or Register  to view this content.
    [/code]
    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!)

  4. #4
    Registered User
    Join Date
    11-26-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Copying certain text in textfile and paste into excel

    thanks a lot Leith Ross
    it works great!!

+ 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