+ Reply to Thread
Results 1 to 4 of 4

Question about replacing Word text from Excel in many files

  1. #1
    Registered User
    Join Date
    02-18-2005
    Posts
    93

    Question about replacing Word text from Excel in many files

    We lost several electrical stations due to flooding in the Midwest. They are replacing the room numbers with new numbers but all our procedures will have the old numbers on them. Has anyone ever attempted a massive replacement of text from Excell to Word? I am not asking for the program, just whether it can be done with Macros. If there are 100 documents in different folders, would the path for each have to be written seperately?
    Thanks in advance, I have written simple macros but am not sure how to tackle this one. Are there any reference articles out there?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Deb,

    Based on what you have said I would answer yes to your questions about can it be done with macros and across multiple files. There are several file search methods you can use to eliminate having to type in each folder path. Application.FilesSearch and using the File System Object are propbably the two easiest methods to use for recursive folder and file searching. As for the part about replacing text in Word documents, that could prove to be quite challenging. If the document layout is the same then it makes the job much easier, but I don't that is the case here. You will need to write VBA code for both Excel and Word to automate updating your files. If you need help, just ask.

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    02-18-2005
    Posts
    93
    Thanks Leith,
    I am afraid that inconsistency will be the downfall to this. the MCC number could be like MCC156, MCC-156 or in a table with a column labeled MCC
    Since this is huge safety issue (electrical buckets) I am not sure I would trust anything to do the job correctly. I will read up on the folder searches you mentioned and see if what is required.
    Thanks again

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Deb,

    Also look into pattern matching using the Like statement. This would help you locate the different versions of the MCC number in text.

    Sincerely,
    Leith Ross

+ 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