Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell to Cell Data Transfer
Fellow Forum Members,
I need to transfer data cell for cell from Excel into an existing table in Word 2003. The table in Word utilizes headers. The problem I am encountering is that the code does not recognize the headers and is not transfering the data cell to cell. Can anyone out there help me out with some coding that will accomplish this task? Any help will be greatly appreciated. Below is the code I would like to modify to accomplish the task of transfering data from Excel to Word table. If there is a better code out there please let me know. Thanks. It will open a word document named test.doc it will then select the bookmark named test. It will then copy the range A1:E401 from the active workbook to the word document at the point in the document where the test bookmark occurs. VB: AutoLinked keywords will cause extra spaces before keywords. Extra spacing is NOT transferred when copy/pasting, but IS if the keyword uses "quotes". Dim wdApp As Object Dim wd As Object Dim oIshp As Object On Error Resume Next Set wdApp = GetObject(, "Word.Application") If Err.Number < 0 Then Set wdApp = CreateObject("Word.Application") End If On Error Goto 0 Set wd = wdApp.Documents.Open("C:\test.doc") wdApp.Visible = True Range("A1:E401").Copy wd.Bookmarks("test").Select wdApp.Selection.PasteExcelTable False, False, Fals |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell to Cell Data Transfer
Maybe this site will help.
http://www.microsoft.com/AtWork/getw...imesaving.mspx "binar" wrote: Fellow Forum Members, I need to transfer data cell for cell from Excel into an existing table in Word 2003. The table in Word utilizes headers. The problem I am encountering is that the code does not recognize the headers and is not transfering the data cell to cell. Can anyone out there help me out with some coding that will accomplish this task? Any help will be greatly appreciated. Below is the code I would like to modify to accomplish the task of transfering data from Excel to Word table. If there is a better code out there please let me know. Thanks. It will open a word document named test.doc it will then select the bookmark named test. It will then copy the range A1:E401 from the active workbook to the word document at the point in the document where the test bookmark occurs. VB: AutoLinked keywords will cause extra spaces before keywords. Extra spacing is NOT transferred when copy/pasting, but IS if the keyword uses "quotes". Dim wdApp As Object Dim wd As Object Dim oIshp As Object On Error Resume Next Set wdApp = GetObject(, "Word.Application") If Err.Number < 0 Then Set wdApp = CreateObject("Word.Application") End If On Error Goto 0 Set wd = wdApp.Documents.Open("C:\test.doc") wdApp.Visible = True Range("A1:E401").Copy wd.Bookmarks("test").Select wdApp.Selection.PasteExcelTable False, False, Fals |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Transfer data from a cell to another workbook if certain criteria | Excel Worksheet Functions | |||
transfer data cell from another work sheet | Excel Worksheet Functions | |||
How do i transfer cell data from one sheet to the other in Excel | New Users to Excel | |||
Transfer cell data from one worksheet to another === URGENT | Excel Discussion (Misc queries) | |||
Can data from one ws transfer to another IF cell has text? | Excel Worksheet Functions |