+ Reply to Thread
Results 1 to 3 of 3

find and replace in multiple docs.

  1. #1
    Registered User
    Join Date
    10-25-2012
    Location
    Thailand
    MS-Off Ver
    Excel 2007, 2013
    Posts
    30

    find and replace in multiple docs.

    I have a multiple documents that I use a lot and often need to change specific names in the docs, the date and the name of the doc. To assist me with things that need to change, I use XXXXXXXX and ZZZZZZZZ as place holders in the docs. The file name also uses XXXXXXXX in the name to remind me to change it.

    I copy the original of each doc and then change the name. I open each doc then use replace to change the XXXXXXXX and ZZZZZZZZ to the name I want and include match case. I would like to automate this process with VBA.

    I assume it would work like this.
    • I would put a copy of the original docs into a known folder.
    • Running the code would open up a dialog box with text box to add the name to replace the XXXXXXXX in the file name and the XXXXXXXX and ZZZZZZZZ in the file text of the files.
    • I assume it would be a process of looping through all the files in the folder and renaming them using the contents of the text boxes.
    • Then opening each file and running a match case replace on the contents and then saving.

    I'm at a loss as to how to start this. I understand basic loops in VBA for Excel and things like that, but this sort of manipulation I I'm not sure what to so. Does anyone have any pointers on how to approach this?

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: find and replace in multiple docs.

    This has been discussed before, in multiple threads. See, for example:
    https://www.excelforum.com/word-prog...ml#post4731113
    https://www.excelforum.com/word-prog...ml#post4789212
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Registered User
    Join Date
    10-25-2012
    Location
    Thailand
    MS-Off Ver
    Excel 2007, 2013
    Posts
    30

    Re: find and replace in multiple docs.

    Thank you. I didn't even realize I had previously posted it and I did a search. I have just opened up Developer in Word and have found I have a done a lot of work on this already. I'll finish this project as time permits and post here.

    Thank you. This code will assist greatly http://www.msofficeforums.com/word-v...ocx-files.html

    Regards,

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro to Find and Replace Multiple Values Across Multiple Sheets
    By MattyD123 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-09-2018, 10:44 PM
  2. VBA for replace function for use with multiple docs.
    By stan101 in forum Word Programming / VBA / Macros
    Replies: 1
    Last Post: 11-22-2017, 04:30 AM
  3. pull certain data from google docs form-produced spreadsheet to other docs
    By MisterCadillac in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 03-11-2014, 04:49 AM
  4. find and replace multiple values across multiple worksheets
    By Blake 7 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-13-2012, 10:48 AM
  5. [SOLVED] Do Find & Replace multiple times using data in Col B for find & data in Col C for replace
    By ILoveStMartin in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-29-2012, 08:23 AM
  6. Excel 2007 : How to merge 2 excel docs into multiple docs
    By T Johnson in forum Excel General
    Replies: 1
    Last Post: 06-06-2012, 12:09 PM
  7. Multiple Find and Replace to replace a list of strings
    By WalterP34 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-11-2011, 07:41 PM

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