Data Automation from Excel to Word

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know how to get cell data (from multiple) cells into a Word
Document (New or a Template) by the click of a form button??
 
Adam,

The following Excel macro will copy all data from selected cells into a new
Word document

Sub moveToWord()
Set x = CreateObject("Word.Application")
x.Documents.Add
x.Visible = True

For Each cl In Selection

x.Selection.TypeText CStr(cl.Value)
x.Selection.TypeParagraph

Next
End Sub

http://HelpExcel.com
 
Forgot to mention that. You can tie this code to a form command button, or
use the code in between Sub and End Sub directly into a Command Button from
the Control Toolbox or a UserForm.

http://HelpExcel.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top