+ Reply to Thread
Results 1 to 4 of 4

Data Automation from Excel to Word

  1. #1
    Adam
    Guest

    Data Automation from Excel to Word

    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??

  2. #2
    galimi
    Guest

    RE: Data Automation from Excel to Word

    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

    "Adam" wrote:

    > 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??


  3. #3
    Adam
    Guest

    RE: Data Automation from Excel to Word

    So I just put this into the VBA code for a command button, correct?

    "galimi" wrote:

    > 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
    >
    > "Adam" wrote:
    >
    > > 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??


  4. #4
    galimi
    Guest

    RE: Data Automation from Excel to Word

    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

    "Adam" wrote:

    > So I just put this into the VBA code for a command button, correct?
    >
    > "galimi" wrote:
    >
    > > 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
    > >
    > > "Adam" wrote:
    > >
    > > > 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??


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1