![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
I know absolutly nothing about word can someone help me I have a workbook with some address fields in it.
What I want to do is create a macro that opens up a new letter in word and puts in the address fields selected in excel. Any Ideas? |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Hellas
Posts: 553
|
Hello Bretvba
I know that word has that option , under tools,mail merge , where you can setup this communication with excel.
__________________
Best Regards Andreas
|
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
yeah,
What I really want is just a copy and paste function to put the address in the right spot. Im using forms and when a user clicks the details they want, I want to open a new document and put in the relevant data in the form of a letter Any Ideas?? |
|
|
|
|
|
#4 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
You could just copy and paste for a one time process. But a macro could look like the following:
_________________ Cheers, NateO [ This Message was edited by: NateO on 2002-05-22 19:17 ] |
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
Thanks Nate
I think I can work that to fit my needs Cheers |
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
sorry i cannot get what I want to work.
What I am trying to achieve is when the macro is run the different fields get transfered from excel into a word document. I am not sure what I would need to complete this any more Ideas?? |
|
|
|
|
|
#7 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
When you say it doesn't work, what do you mean? E.g., errors, nothing, wrong range, etc.....
_________________ Cheers, NateO [ This Message was edited by: NateO on 2002-05-22 18:37 ] |
|
|
|
|
|
#8 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
hi Nate
could not get the code to work its also kinda not what Im hoping to do what Ive got is a form with address's on it when the user clicks an address and clicks the create letter button I want it to Put the required fields in the letter, I can get the information in variables but I want to insert the information into word so the user can then create a letter hopefully without copy and paste. Can you reference lines and columns in word? Hope thats clear enough can you help? |
|
|
|
|
|
#9 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
I love the subroutine name there, Cameo.
"Yo, pretty ladies around the world..." (I've just turned into AudioJoe" |
|
|
|
|
|
#10 |
|
MrExcel MVP
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
|
Hi Bret.
There Probably is a better way of doing this but it worked for me .... I was able to select a name in excel and have a form letter open in word with the appropriate information in it ... is that what you want ? If soooo then this is how I did it .... 1) created a extra sheet (you may be able to hide it ) in my xls workbook 2) Put the appropiate headers on the blank xls sheet I.e. name address etc , and added one line of persons information 2)I then wrote a macro to copy the selected row to the "spare" spreadsheet. AND then Open a Word Document called MyFormLetter. HOW TO CONFIGURE myFormLetter PRIOR to running macro. 1) Open up Word and Open Mail Merge 2) Use Mail Merge wizard to point to the spreadsheet that is blank except for header and 1 line of information. 3) Create you formletter with the one line of information from xls sheet. 4) Save file with 1 line of info showing DONE: Now to use, click on the source Spreadsheet which will A) copy the one row of info to the Row One of the sheet that Mail Merge uses for dataBase. B) Opens the Mail Merge document call MyFormLetter with the appropriate information in place. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|