PDA

View Full Version : Autofill Macro from EXCEL to WORD



rs.blackcat
07-10-2012, 06:25 PM
Hello,

I'm completely new using VBA, macros and programming as a whole. I'm trying to make a macro that replaces some predefined words from a *.doc document with values (in this case words) of a cell from an excel-sheet.

My aim is to have an automation for an excel-sheet with the data as shown below. And a form/application/some ms-word document that needs to be fill out.

FIST_NAME MIDDLE_NAME LAST_NAME D.O.B

The macro will just replace the values entered in the excel-sheet to the *.doc document.

Can someone please help me with this? Thank you.

Kenneth Hobs
07-10-2012, 08:20 PM
IF you want to Replace a string then you need a Find string.

'FindReplace Text
' http://www.excelforum.com/excel-programming/682014-replace-word-in-ms-word-with-varable-from-ms-excel.html
' Multiple Find/Replace
' http://www.excelforum.com/excel-programming/794297-struggling-with-a-find-replace-macro-to-word.html
' Single Find/Replace
' http://www.vbaexpress.com/forum/showthread.php?t=38958

snb
07-11-2012, 03:08 AM
I think you should look at the mailmerge method in Word.
You can link the Excel file to the Word file and insert ('replace') the Excel data in the Word document.