+ Reply to Thread
Results 1 to 1 of 1

Import text file into Excel and using a loop to count unique words within the text

  1. #1
    Registered User
    Join Date
    United States
    MS-Off Ver
    Excel 2010

    Import text file into Excel and using a loop to count unique words within the text

    I just want to mention I am taking a VBA class right now and I am pretty terrible at it.

    We have a homework problem that we need to import text from a text file and then loop through the text and make a count of all of the words within the text. The output will then be put in an Excel sheet with column A being the word and column B being the count. Variables already came defined which you can see in the attachment. Any help would be appreciated. I've been looking at this for a while and I just don't find VBA programming very intuitive.

    Here is the starter code...

    Please Login or Register  to view this content.
    Like I said, the variables were already defined and I wrote the clear contents and the open file part myself. I understand that the Open fileName command is only bringing in the first line of the text file and adding that to the string dataLine. I was trying to do the problem with only one line of text to see if I could understand it, but I haven't had any luck. Attached is the original Excel file and text file.
    Thanks in advance.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


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