+ Reply to Thread
Results 1 to 5 of 5

VBA Macro Excel to Word replace all

  1. #1
    Registered User
    Join Date
    11-01-2016
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    2

    Question VBA Macro Excel to Word replace all

    Hi Everyone,

    Does anyone know of simple VBA macro code that I can use to make data in excel cells auto replace phrases in a word document?

    For example if I have data in B:3 and I want it to be input into a word document where the word 'ofice' is. how would I go about doing this.

    or is there an easier way of doing this?

    Any help would be much appreciated.

    Thanks

    Chris

  2. #2
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: VBA Macro Excel to Word replace all

    Open your Word document. Press Ctrl H. Type 'ofice' in find. Type the phrase you want to replace it with in 'replace with'. Replace all. If you must do it by macro, why get Excel involved? Word supports VBA.

    If you want to use abbreviations or auto-correct common mistakes you make, use Word's 'Auto correct' feature in File>Options>Proofing
    Last edited by Neil_; 11-02-2016 at 03:55 AM.
    Frob first, tweak later

  3. #3
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: VBA Macro Excel to Word replace all

    of simple VBA macro code
    Moderate is how I would describe it.

    Are all the replacements in one Word file?

    Is this like a template Word file?

    A sample file of each would be helpful. (You can upload here. Scroll down to Manage Attachments.)
    David
    (*) Reputation points appreciated.

  4. #4
    Registered User
    Join Date
    11-01-2016
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    2

    Re: VBA Macro Excel to Word replace all

    Thanks Tinbendr.

    I have added the check list I use plus a sample block of text. The report is basically a template where I need to do around 12 'replace all' tasks before I can add my manual wording.

    It would be really handy if I could automate the checklist to do these for me.

    Thanks
    Attached Files Attached Files

  5. #5
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: VBA Macro Excel to Word replace all

    OK, give this a try.

    Rename the docx file to a dotx file. (Website thinks it's invalid.)

    Change the paths as required.

    Please Login or Register  to view this content.
    This code is kinda fixed, but easy to understand and modify.

    I would tend to write a table, like sheet2, to handle a situation like this. (See the second macro.)
    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)

Similar Threads

  1. Find and Replace in Word document from Excel macro
    By r.vanmoorsel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2015, 04:24 PM
  2. Need a macro for batch find and replace in word using excel
    By ramradha6 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-25-2014, 03:29 AM
  3. [SOLVED] Excel macro- Find replace an itallic font word with a regular word?
    By thisisaboutwork in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-08-2013, 01:48 PM
  4. Need help with Excel-to-Word find and replace macro based on word filename
    By EnterTheSerpent in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-16-2013, 12:48 PM
  5. Word text replace from Excel macro
    By GoDuncan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-18-2011, 01:08 PM
  6. Find/Replace macro from excel to word
    By Matt in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-31-2006, 10:48 PM
  7. Find/Replace macro from excel into Word
    By Matt in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-28-2006, 11:40 AM

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