Coping data from excel toword

O

Oggy

Hi

I am writing a macro in excel to copy data from a cell and put it in a
new word document. I have managed this OK, but i am struggling to find
a code that copies a group of cells together, IE all the data in
cells G10:L2000

Has anyone got any suggestions for me?

Thanks

Oggy
 
C

Cindy M.

Hi Oggy,
I am writing a macro in excel to copy data from a cell and put it in a
new word document. I have managed this OK, but i am struggling to find
a code that copies a group of cells together, IE all the data in
cells G10:L2000
Copying to the clipboard is never a very good idea if there's another
possible approach. There are a number of ways to achieve this, such as
reading the cell data, then writing it to the Word document range.

If you want to import entire tables, what I usually do is to create a
LINK field the references the workbook, sheet and range, then break the
link.

Select some cells in Excel, copy, then in Word use Edit/Paste Special
with Link. Press Alt+F9 to see the syntax required for a LINK field.

Use the Fields.Add method in the Word object model to create the link
field to the Excel range you want to insert.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 

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

Top