+ Reply to Thread
Results 1 to 4 of 4

Parse Text file

  1. #1
    Registered User
    Join Date
    06-23-2011
    Location
    Texas
    MS-Off Ver
    Excel 2003
    Posts
    28

    Parse Text file

    I have coded this so far:

    Please Login or Register  to view this content.
    Once the file is inputted into the excel sheet it all goes into column A. I want to use vba to separate each column the end results should have column A and B filled. Attach is the file I used to open and wanting to parse.
    Attached Files Attached Files
    Last edited by noodle48; 07-22-2011 at 12:06 PM. Reason: Solved

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Parse Text file

    Hi Noodle,

    Try adding this bit of code to the end of your macro (just before End Sub):
    Please Login or Register  to view this content.
    Hope that helps!

  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: Parse Text file

    Hello noodle48,

    I made a few changes to your code. The fields variable is split using the space delimiter into an 1-D array. This array can then be directly loaded into the cells Ax:Bx in your loop. I have marked the additions in bold text,
    Please Login or Register  to view this content.
    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
    06-23-2011
    Location
    Texas
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Parse Text file

    Thanks for your inputs but I got the code to work thanks to Paul. That code work 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