Any luck with this, Volibrawl?
Ray
Main Topics
Browse All TopicsIs it possible (how) to do something like a mail merge in Excel? What I want to do is to print the same worksheet with different client data at the top for several dozen clients. The client data is in Access and I can query and import it into an excel worksheet/table. Can I then somehow (macro maybe) copy the data to the appropriate area, print the worksheet, then move down the list to the next customer?
Any tricks or help welcomed..
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.
Business Accounts
Answer for Membership
by: RayBlakePosted on 2002-11-14 at 21:32:40ID: 7451697
Yes, you can. It needs very little VBA. Lets assume your client data table looks like this and is in a worksheet called DataTable:
1)
1) 1) 1)
te s.PrintOut Copies:=2 'assume you want to keep a file copy too!
A B C D
1 CLIENT | REVENUE | CONTACT | PHONE
2 ABC Ltd | 200,000 | Peter | 555-1234
3 DEF Ltd | 300,000 | Mary | 555-2345
4 GHI Ltd | 400,000 | Mr Lean | 555-3456
On the sheet you want to 'merge' the data to (We'll call it MainSheet), let's say that the details need to go in the range C2:F2 and let's assume that cell C1 is empty and available.
In C1 enter:
1
In C2 enter:
=index(DataTable!a2:a4,$c$
Drag this across so that D2, E2, and F2 say respectively:
=index(DataTable!b2:b4,$c$
=index(DataTable!c2:c4,$c$
=index(DataTable!d2:d4,$c$
In this example, we're using the a2:a4, etc because there are 3 pieces of data. You can change this, of course.
Use the following routine to perform the "merge":
sub MergeItAndPrint
Sheets("MainSheet").Activa
For myLoop = 1 to 3
Range("C1").Value = myLoop
ActiveWindow.SelectedSheet
Next myLoop
EndSub
I'd suggest for the sake of neatness that the counter number you store in C1 is obscured. You can do this by selecting that cell and giving it the custom format ;;; which will render its content invisible.
Regards.
Ray