Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VBA to transfer data from excel to word 1

Status
Not open for further replies.

Grant2000

Programmer
Feb 13, 2000
1
0
0
US
Does anyone have any idea how to perform this kind of function or can suggest any resources that deal with this?
 
In Excel, type some text in cell A1 and insert this macro to get you started. Do not forget to add Tools&gt;References&gt;Microsoft Word Object Library to the references.<br><br>Public Sub ExcelToWord()<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim wdapp As Word.Application<br>&nbsp;&nbsp;&nbsp;&nbsp;Set wdapp = New Word.Application<br>&nbsp;&nbsp;&nbsp;&nbsp;wdapp.Visible = True<br>&nbsp;&nbsp;&nbsp;&nbsp;wdapp.Application.WindowState = wdWindowStateMaximize<br>&nbsp;&nbsp;&nbsp;&nbsp;wdapp.Documents.Add<br>&nbsp;&nbsp;&nbsp;&nbsp;wdapp.Selection.TypeText Text:=Range(&quot;A1&quot;).Text<br>&nbsp;&nbsp;&nbsp;&nbsp;wdapp.Selection.TypeParagraph<br>&nbsp;&nbsp;&nbsp;&nbsp;Set wdapp = Nothing<br>End Sub<br><br>Hope this gets you in the right direction!<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top