+ Reply to Thread
Results 1 to 6 of 6

Getting data into Excel worksheet from Word Documents??

  1. #1
    Registered User
    Join Date
    10-28-2010
    Location
    Denmark, Europe
    MS-Off Ver
    Excel 2010
    Posts
    62

    Getting data into Excel worksheet from Word Documents??

    Hi

    Can someone help me (again) with a bit of vba coding? In need to write a code that looks into the cells in column C (containing paths for doc files on my computer) opens the *.doc file, finds the first line beginning with u* and copies/selcts whatever it finds of numbers [0-9] and of the characters [-] and [.] ending at the next ^p (paragraph break) What I'm looking for is a ref-number alway following a keyword staring with a u* in one of the first lines of the documents (not always the same line though). The ref-number always takes the form "[0-9]*\-[0-9]*\-[0-9]*\.[0-9]*"

    This selection should then be copied to the cell i column A on the same row.

    No changes should be made to the doc files....

    thanks.
    Last edited by Flabbergaster; 12-05-2012 at 11:49 AM.

  2. #2
    Registered User
    Join Date
    10-28-2010
    Location
    Denmark, Europe
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: Getting data into Excel worksheet from Word Documents??

    This is how far I got on my own, going through the Internet, and trying all sorts of things. For the record I'm still only trying to learn writing in vba.
    This one opens and closes the documents referred to in my worksheet, but I still can't find the right code to find at copy the specific content. Guess I need to use some reg ex code

    Please Login or Register  to view this content.
    And maybe I also need to add some line in the code, to make sure I don't mess up the doc files, some "read only/do not change"-limitation
    Last edited by Flabbergaster; 12-05-2012 at 05:20 PM.

  3. #3
    Registered User
    Join Date
    10-28-2010
    Location
    Denmark, Europe
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: Getting data into Excel worksheet from Word Documents??

    Please Login or Register  to view this content.
    Last edited by Flabbergaster; 12-06-2012 at 09:54 AM.

  4. #4
    Registered User
    Join Date
    10-28-2010
    Location
    Denmark, Europe
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: Getting data into Excel worksheet from Word Documents??

    No one?
    Where I'm stuck, I guess, is at the part where I need to get the Matchcollection.value copied to my excel-sheet.

    The Matchcollection should only contain one hit (since global = False, right), but Matchcollection(.value).copy, doesn't work.

    I'm quite new, so maybe the path I have chosen is ridiculous

  5. #5
    Registered User
    Join Date
    10-28-2010
    Location
    Denmark, Europe
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: Getting data into Excel worksheet from Word Documents??

    I desperately need some help with the last part of this...

    This code works... But it gives me only the number of matches, not the match itself. Trying to get the match.value/txt I get an error saying the the method do not support that.. What should I change?

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-28-2010
    Location
    Denmark, Europe
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: Getting data into Excel worksheet from Word Documents??

    Finally...

    Please Login or Register  to view this content.
    Last edited by Flabbergaster; 12-06-2012 at 06:10 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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