GirishDhruva
Active Member
- Joined
- Mar 26, 2019
- Messages
- 308
Hi Everyone,
Here i am trying to convert data's from excel to word as a letter format but as i debugged and checked, from the highlighted line the code is skipped.
Can i know what wrong i have done/what changes i should make????
https://app.box.com/s/ylrujmxp79v84m0ejc50jw7spheo8a1y
In above link i have shared my worksheet
Below is my code
Thanks in advance.
Here i am trying to convert data's from excel to word as a letter format but as i debugged and checked, from the highlighted line the code is skipped.
Can i know what wrong i have done/what changes i should make????
https://app.box.com/s/ylrujmxp79v84m0ejc50jw7spheo8a1y
In above link i have shared my worksheet
Below is my code
Rich (BB code):
Sub ControlWord()
Dim appWD As Word.Application
Set appWD = CreateObject("Word.Application.8")
appWD.Visible = True
Sheets("Revision").Select
FinalRow = Range("A9999").End(xlUp).Row
For i = 2 To FinalRow
Sheets("Revision").Select
Range("B" & i).Copy Destination:=Sheets("Template").Range("B3")
Range("B" & i).Copy Destination:=Sheets("Template").Range("C5")
Range("A" & i).Copy Destination:=Sheets("Template").Range("E5")
Range("C" & i).Copy Destination:=Sheets("Template").Range("G5")
Range("D" & i).Copy Destination:=Sheets("Template").Range("I5")
Range("F" & i & ":L" & i).Copy Destination:=Sheets("Template").Range("B9")
Worksheets("Template").Select
ActiveSheet.UsedRange.Select
Selection.Copy
appWD.Documents.Add
appWD.Selection.Paste
appWD.ActiveDocument.SaveAs Filename:="Revised" & i
appWD.ActiveDocument.Close
Next i
appWD.Quit
End Sub
Thanks in advance.
Last edited: