Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 683
Default Macro to copy cell data to word document based on an active row?

I have an Excel sheet that has several rows of data.

Is it possible for the user to highlight a cell in column A and then copy
data from that row (specific cells) to a word document that has been
previously created and contains bookmarks?

Excel
A B C D
1 J Smith 65 01/01/04 Mazada 6
2 S Jones 36 03/02/04 Mini
3 G Hall 25 06/06/04 Civic

So the user will highlight one of the rows and then the macro will copy only
the cells A, C, D and place them into the word document

Word
Dear, (name)

Thank you for purchasing (car) on (date)


any help would be greatly appreciated

Brian
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Macro to copy cell data to word document based on an active row?

You may want to look into MailMerge (in MSWord).

These links may help:

http://www.mvps.org/dmcritchie/excel/mailmerg.htm
http://www.mvps.org/word/FAQs/MailMerge

The first is from David McRitchie and the second is by Beth Melton and Dave
Rado.

IIRC, you could filter the database just for certain records. If worse comes to
worse, you could add a new column and make it explicit (Yes/No) and filter by
that when you're doing the mailmerge.





Brian wrote:

I have an Excel sheet that has several rows of data.

Is it possible for the user to highlight a cell in column A and then copy
data from that row (specific cells) to a word document that has been
previously created and contains bookmarks?

Excel
A B C D
1 J Smith 65 01/01/04 Mazada 6
2 S Jones 36 03/02/04 Mini
3 G Hall 25 06/06/04 Civic

So the user will highlight one of the rows and then the macro will copy only
the cells A, C, D and place them into the word document

Word
Dear, (name)

Thank you for purchasing (car) on (date)

any help would be greatly appreciated

Brian


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 683
Default Macro to copy cell data to word document based on an active ro

Thanks Dave for the links.

I was able to use some code from previous posts on this site, which appears
to work using Bookmarks. I will also look at the mailmerge option with your
tip of using a filter.

Brian

"Dave Peterson" wrote:

You may want to look into MailMerge (in MSWord).

These links may help:

http://www.mvps.org/dmcritchie/excel/mailmerg.htm
http://www.mvps.org/word/FAQs/MailMerge

The first is from David McRitchie and the second is by Beth Melton and Dave
Rado.

IIRC, you could filter the database just for certain records. If worse comes to
worse, you could add a new column and make it explicit (Yes/No) and filter by
that when you're doing the mailmerge.





Brian wrote:

I have an Excel sheet that has several rows of data.

Is it possible for the user to highlight a cell in column A and then copy
data from that row (specific cells) to a word document that has been
previously created and contains bookmarks?

Excel
A B C D
1 J Smith 65 01/01/04 Mazada 6
2 S Jones 36 03/02/04 Mini
3 G Hall 25 06/06/04 Civic

So the user will highlight one of the rows and then the macro will copy only
the cells A, C, D and place them into the word document

Word
Dear, (name)

Thank you for purchasing (car) on (date)

any help would be greatly appreciated

Brian


--

Dave Peterson


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy table from Word Document to Excel Mythili Excel Discussion (Misc queries) 0 May 3rd 07 10:50 AM
copy name from active sheet to cell - using macro or function dymek Excel Worksheet Functions 2 October 2nd 06 12:32 PM
Copy of Word document Shookie New Users to Excel 1 September 8th 06 06:09 PM
How do I copy a Word document into Excel and have it look good? djsgrammy Excel Discussion (Misc queries) 2 February 7th 06 11:36 PM
question about - excel macro copy chart to word document Jani[_2_] Excel Programming 2 January 16th 04 05:25 PM


All times are GMT +1. The time now is 10:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"