Thanks, but I have a question,
where (exactly) which tab and page and how(exactly) do I add in this code...
Main Topics
Browse All TopicsIs this a mail merge or macro.
I have an excel file with a 'format' of how I want things layed out. I want to create and print a document for each contact I have, each contact
having its own file (print).
In the template file I the first bunch of cells for example are A1-A5 to be populated with customer information.
I have another excel file that has a list of all of the customer, and I dont want to go one by one and copy and paste from the master list and into an excel file and then print out a copy for each contact.
I know there has to be some macro or linking or something I can use within excel I have both 2007 and 2003.
So basically I want to take the value of column H and paste into a1 of the template
the value of G into A2 of the template
the value of I inot A4 of the template.
and a few more, once this is done, I have moved one whole contact from the list to the this template file and now its ready to be printed....
I want this done a numerous times..
Anyone have any suggestions to save me the time of copying and creating a new file for over 130 contacts?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
In 2003...
Open the Worksheet
Go to Tools - Macro - Visual Basic Editor
The Project Explorer window should appear on the left side of the screen. If it doesn't, press CTRL+R to show it.
Double Click on "This Workbook" (you may need to expand the tree to see it)
Paste the code there.
The sheet name (tab) you want the data to come from should be "List" and the sheet name (tab) you want the data to be linked to should be "Layout"
I have attached a sample spreadsheet for you to play with that has a few records. If Macros are disabled in your Excel 2003 (as they are by default), you will need to lower the security setting. You do this by Tools - Options - Security Tab - Macro Security Button (towards bottom) and setting it to medium security (prompt)
Any other questions, let me know.
Business Accounts
Answer for Membership
by: englanddgPosted on 2009-10-22 at 06:33:25ID: 25633930
Few assumptions here...
a) The column H *always* has data. This is used to tell the loop when to stop. If this is not the case, edit the two lines that say z = Sheets("List").Range("H" & x).Value
b) The data on your list starts on Row 1. If this is not the case, edit the value of x to the correct row (e.g. if there is a header row you don't want to print)
c) The list and format sheets are in the same workbook. The list (where you want the data to come from) is labeled "List" as the sheetname, and the formatted sheet you want to print out is called "Layout" If they are not in the same workbook, the code will need to be changed, or you can create a new sheet and copy the data over. It does not matter if there are other sheets in the workbook, as long as these two sheets exist with those exact sheetnames. If you want to use a different sheetname, search and replace the names from the code below.
d) I put a message box into the loop. If you don't want it to appear, either comment it out (put a ' before the line, it should turn green), or delete the line that says Msgbox "Printing Contact " & H & "."
Simply copy and paste the code snippet into the workbook as a new macro and enjoy!
Hope that helps! If it doesn't work, let me know and I'll be glad to help figure out why.
Select allOpen in new window