+ Reply to Thread
Results 1 to 2 of 2

copy excel cell to cell in word table using excel macro

  1. #1
    jthurnwps
    Guest

    copy excel cell to cell in word table using excel macro

    I have a macro in excel that copies a cell, opens a word document, moves the
    cursor to a specific location, then pastes what was copied. After that it
    goes to a new location in the word document (which is in a table), goes back
    to the excel spreadsheet which is still active, copies a new cell then
    returns to the word document to paste that. So far I have tried numerous
    coding to get the data to paste but it hasn't happened. Can someone please
    tell me what I am doing wrong?
    Here is the code:

    Range("A1").Select
    Selection.Copy
    Set wrdApp = CreateObject("Word.Application")
    Set wrdDoc = wrdApp.Documents.Open("Mydoc.doc")
    wrdApp.Visible = True
    wrdApp.Selection.MoveDown Unit:=wdLine, Count:=2
    wrdApp.Selection.MoveRight Unit:=wdCharacter, Count:=45Windows
    wrdApp.Selection.PasteAndFormat (wdPasteDefault)
    wrdApp.Selection.MoveUp Unit:=wdLine, Count:=9
    Windows("Myexcel").Activate
    Range("A4").Select
    Selection.Copy
    wrdApp.Selection.PasteExcelTable False, False, False

  2. #2
    Registered User
    Join Date
    07-08-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    2

    Re: copy excel cell to cell in word table using excel macro

    I am having similar problem. I have lets say 10 rows and 5 column table in excel sheet. Corresponding to each row, I have a table in word template. I need to use data in A1 to find table with heading 'A1' and then add data from B1, C2, D1, E1 in to that table in word doc. I can scroll in word doc, however not sure how to find table corresponding to A1 and then copy paste cell data. Any poninters?

+ 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