Create word file then find and replace text from excel to word file

icesanta

Board Regular
Joined
Dec 17, 2015
Messages
65
You have one excel file with below information and 1 word file NAMEWORD.docx as template. Now find and replace below data and create a word file from each row in excel sheet

HTML:
[RANGE=cls:xl2bb-100][XR][XH=cs:14]Excel 2007[/XH][/XR][XR][XH][/XH][XH]A[/XH][XH]B[/XH][XH]C[/XH][XH]D[/XH][XH]E[/XH][XH]F[/XH][XH]G[/XH][XH]H[/XH][XH]I[/XH][XH]J[/XH][XH]K[/XH][XH]L[/XH][XH]M[/XH][/XR][XR][XH]5[/XH][XD=h:r][/XD][XD=h:c]Do all find and replace in NAMEWORD.docx[/XD][XD=h:c][/XD][XD=h:c][/XD][XD=h:c][/XD][XD=h:c][/XD][XD=h:c][/XD][XD=h:c][/XD][XD=h:c][/XD][XD=h:c][/XD][XD=h:c][/XD][XD=h:c][/XD][XD=h:c][/XD][/XR][XR][XH]6[/XH][XD=h:l|fw:b]Create File Name and Save as[/XD][XD=h:l|fw:b]Find 1[/XD][XD=h:l|fw:b]Replace 1[/XD][XD=h:l|fw:b]Find 2[/XD][XD=h:l|fw:b]Replace 2[/XD][XD=h:l|fw:b]Find 3[/XD][XD=h:l|fw:b]Replace 3[/XD][XD=h:l|fw:b]Find 4[/XD][XD=h:l|fw:b]Replace 4[/XD][XD=h:l|fw:b]find image 1[/XD][XD=h:l|fw:b]Replace image/name1[/XD][XD=h:l|fw:b]Find 5 (Header Text)[/XD][XD=h:l|fw:b]Replace 5 (Header Text)[/XD][/XR][XR][XH]7[/XH][XD=h:l]CreateWord File NAME1.docx[/XD][XD=h:l]Find 1[/XD][XD=h:l]Replace 1[/XD][XD=h:l]Find 2[/XD][XD=h:l]Replace 2[/XD][XD=h:l]Find 3[/XD][XD=h:l]Replace 3[/XD][XD=h:l]Find 4[/XD][XD=h:l]Replace 4[/XD][XD=h:l]find image 1[/XD][XD=h:l]Replace image/name1[/XD][XD=h:l]Find 5 (Header Text)[/XD][XD=h:l]Replace 5 (Header Text)[/XD][/XR][XR][XH]8[/XH][XD=h:l]CreateWord File NAME2.docx[/XD][XD=h:l]Find 1[/XD][XD=h:l]Replace 1[/XD][XD=h:l]Find 2[/XD][XD=h:l]Replace 2[/XD][XD=h:l]Find 3[/XD][XD=h:l]Replace 3[/XD][XD=h:l]Find 4[/XD][XD=h:l]Replace 4[/XD][XD=h:l]find image 1[/XD][XD=h:l]Replace image/name2[/XD][XD=h:l]Find 5 (Header Text)[/XD][XD=h:l]Replace 5 (Header Text)[/XD][/XR][XR][XH]9[/XH][XD=h:l]CreateWord File NAME3.docx[/XD][XD=h:l]Find 1[/XD][XD=h:l]Replace 1[/XD][XD=h:l]Find 2[/XD][XD=h:l]Replace 2[/XD][XD=h:l]Find 3[/XD][XD=h:l]Replace 3[/XD][XD=h:l]Find 4[/XD][XD=h:l]Replace 4[/XD][XD=h:l]find image 1[/XD][XD=h:l]Replace image/name3[/XD][XD=h:l]Find 5 (Header Text)[/XD][XD=h:l]Replace 5 (Header Text)[/XD][/XR][XR][XH]10[/XH][XD=h:l]CreateWord File NAME4.docx[/XD][XD=h:l]Find 1[/XD][XD=h:l]Replace 1[/XD][XD=h:l]Find 2[/XD][XD=h:l]Replace 2[/XD][XD=h:l]Find 3[/XD][XD=h:l]Replace 3[/XD][XD=h:l]Find 4[/XD][XD=h:l]Replace 4[/XD][XD=h:l]find image 1[/XD][XD=h:l]Replace image/name4[/XD][XD=h:l]Find 5 (Header Text)[/XD][XD=h:l]Replace 5 (Header Text)[/XD][/XR][XR][XH]11[/XH][XD=h:l]CreateWord File NAME5.docx[/XD][XD=h:l]Find 1[/XD][XD=h:l]Replace 1[/XD][XD=h:l]Find 2[/XD][XD=h:l]Replace 2[/XD][XD=h:l]Find 3[/XD][XD=h:l]Replace 3[/XD][XD=h:l]Find 4[/XD][XD=h:l]Replace 4[/XD][XD=h:l]find image 1[/XD][XD=h:l]Replace image/name5[/XD][XD=h:l]Find 5 (Header Text)[/XD][XD=h:l]Replace 5 (Header Text)[/XD][/XR][XR][XH]12[/XH][XD=h:r][/XD][XD=h:r][/XD][XD=h:r][/XD][XD=h:r][/XD][XD=h:r][/XD][XD=h:r][/XD][XD=h:r][/XD][XD=h:r][/XD][XD=h:r][/XD][XD=h:r][/XD][XD=h:r][/XD][XD=h:r][/XD][XD=h:r][/XD][/XR][XR][XH=cs:14][RANGE][XR][XD]Sheet6[/XD][XH][/XH][/XR][/RANGE][/XH][/XR][/RANGE]
 
Last edited:

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Code:
[B]Excel 2007[/B][TABLE]
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>[TR="bgcolor: #E0E0F0"]
[TH][/TH]
[TH]A[/TH]
[TH]B[/TH]
[TH]C[/TH]
[TH]D[/TH]
[TH]E[/TH]
[TH]F[/TH]
[TH]G[/TH]
[TH]H[/TH]
[TH]I[/TH]
[TH]J[/TH]
[TH]K[/TH]
[TH]L[/TH]
[TH]M[/TH]
[/TR]
</thead><tbody>[TR]
[TD="align: center"]5[/TD]
[TD="align: right"][/TD]
[TD="align: center"] Do all find and replace in NAMEWORD.docx[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD]Create File Name and Save as[/TD]
[TD]Find 1[/TD]
[TD]Replace 1[/TD]
[TD]Find 2[/TD]
[TD]Replace 2[/TD]
[TD]Find 3[/TD]
[TD]Replace 3[/TD]
[TD]Find 4[/TD]
[TD]Replace 4[/TD]
[TD]find image 1 [/TD]
[TD]Replace image/name1[/TD]
[TD]Find 5 (Header Text)[/TD]
[TD]Replace 5 (Header Text)[/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD]CreateWord File NAME1.docx[/TD]
[TD]Find 1[/TD]
[TD]Replace 1[/TD]
[TD]Find 2[/TD]
[TD]Replace 2[/TD]
[TD]Find 3[/TD]
[TD]Replace 3[/TD]
[TD]Find 4[/TD]
[TD]Replace 4[/TD]
[TD]find image 1 [/TD]
[TD]Replace image/name1[/TD]
[TD]Find 5 (Header Text)[/TD]
[TD]Replace 5 (Header Text)[/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD]CreateWord File NAME2.docx[/TD]
[TD]Find 1[/TD]
[TD]Replace 1[/TD]
[TD]Find 2[/TD]
[TD]Replace 2[/TD]
[TD]Find 3[/TD]
[TD]Replace 3[/TD]
[TD]Find 4[/TD]
[TD]Replace 4[/TD]
[TD]find image 1[/TD]
[TD]Replace image/name2[/TD]
[TD]Find 5 (Header Text)[/TD]
[TD]Replace 5 (Header Text)[/TD]
[/TR]
[TR]
[TD="align: center"]9[/TD]
[TD]CreateWord File NAME3.docx[/TD]
[TD]Find 1[/TD]
[TD]Replace 1[/TD]
[TD]Find 2[/TD]
[TD]Replace 2[/TD]
[TD]Find 3[/TD]
[TD]Replace 3[/TD]
[TD]Find 4[/TD]
[TD]Replace 4[/TD]
[TD]find image 1[/TD]
[TD]Replace image/name3[/TD]
[TD]Find 5 (Header Text)[/TD]
[TD]Replace 5 (Header Text)[/TD]
[/TR]
[TR]
[TD="align: center"]10[/TD]
[TD]CreateWord File NAME4.docx[/TD]
[TD]Find 1[/TD]
[TD]Replace 1[/TD]
[TD]Find 2[/TD]
[TD]Replace 2[/TD]
[TD]Find 3[/TD]
[TD]Replace 3[/TD]
[TD]Find 4[/TD]
[TD]Replace 4[/TD]
[TD]find image 1[/TD]
[TD]Replace image/name4[/TD]
[TD]Find 5 (Header Text)[/TD]
[TD]Replace 5 (Header Text)[/TD]
[/TR]
[TR]
[TD="align: center"]11[/TD]
[TD]CreateWord File NAME5.docx[/TD]
[TD]Find 1[/TD]
[TD]Replace 1[/TD]
[TD]Find 2[/TD]
[TD]Replace 2[/TD]
[TD]Find 3[/TD]
[TD]Replace 3[/TD]
[TD]Find 4[/TD]
[TD]Replace 4[/TD]
[TD]find image 1[/TD]
[TD]Replace image/name5[/TD]
[TD]Find 5 (Header Text)[/TD]
[TD]Replace 5 (Header Text)[/TD]
[/TR]
[TR]
[TD="align: center"]12[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
</tbody>[/TABLE]
[CENTER][COLOR=#161120][B]Sheet6[/B][/COLOR][/CENTER]
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,741
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top