Consulting

Results 1 to 5 of 5

Thread: Specific word count with VBA

  1. #1

    Specific word count with VBA

    Hello all,
    I have been tasked with a project at work that I have hit a brick wall on. I have a MS Word doc in which I need to search the entire document for the words "Pass" and "Fail" the totals will need to be entered into a table 4 columns 2 row - Headers will be "Pass" "Fail" "Total" "Error Rate" with results below though I do NOT need VBA to create the table, just to be able to calculate the number of pass and fails individually. Also is there a way to auto calculate the totals without using F9 (a2+b2) and error rate ((b2/c2)*100"

    Ultimately I would like to click one command bottom and have it all done for me, just wanting to know if it is possible and if so what is the best way for me to accomplish this?

    Thank you all in advance for the support you are so willing to give.

    Adam

  2. #2
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    How is Word to know what "the totals" are? Just a total of the number of occurences of "Pass"? Does upper or lower case happen? Does it make a difference?

    It is easy enough to get a count of any specific word. And to put that count at a specific location, say a cell in a table.

  3. #3
    Yes totals are number of occurrences for pass and fail individually and case does not matter.

  4. #4
    Here to start with
    http://word.tips.net/T001833_Generat...currences.html

    iCount would be responsible for the total.

  5. #5
    I think it would be better if you use Excel VBA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •