PC Review


Reply
Thread Tools Rate Thread

Cell to Cell Data Transfer

 
 
binar
Guest
Posts: n/a
 
      26th Mar 2008
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 With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      26th Mar 2008
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transfer all data from one cell to another, and keep it dynamic ML Microsoft Excel Programming 1 6th Oct 2009 01:31 PM
Transfer single cell information to specific cell based on user criteria RoVo Microsoft Excel Programming 0 31st May 2006 04:20 PM
Can data from one ws transfer to another IF cell has text? Ccp Microsoft Excel Worksheet Functions 3 15th Jul 2005 04:14 AM
transfer data without a formula in that cell Joey Microsoft Excel Misc 2 23rd Jun 2004 04:28 PM
transfer data to next available cell? tricklosan Microsoft Excel Worksheet Functions 1 11th Feb 2004 09:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:05 PM.