Excel as a Database for MailMerge -- How to Produce a List with Variable Results

lindan8r

New Member
Joined
Jul 29, 2002
Messages
12
I am using MSExcel as a database to produce a document in MSWord via MailMerge.

The database needs to be able to create a list of signatories that will vary depending on the document. For example, Mary, Joe, and Laura might need to sign Documents 1, 2, and 3, but only Mary and Joe will sign Documents 1 and 4.

Here is a sample of what I need the final data to look like:

Signatory............Doc#...............Title..................Date
Mary....................1................Guidance.............8/1/13
Mary....................2................Operations...........1/1/13
Mary....................3................Tests..................5/5/13
Mary....................4................Hazards...............6/7/13
Joe......................1................Guidance.............8/1/13
Joe......................2................Operations...........1/1/13
Joe......................3................Tests..................5/5/13
Joe......................4................Hazards...............6/7/13
Laura...................2................Operations...........1/1/13
Laura...................3................Tests..................5/5/13


The problem I'm having is that there are about 45 employees, who will sign up to a total of 72 documents, so the list will be huge, and sometimes we add documents to the list. Therefore, I'd prefer not to have to hand-type each person's name and document information in each time they sign (every quarter).

I've already created a worksheet that will filter the names (via macro) based on the documents that they should sign. But...I don't know how to make that list into the format above, since the names have to repeat for each document, and since the number of names and documents will vary.

This is a fairly complicated thing, so I'd be happy to post a sample worksheet, if that's allowed and would help. I have no clue how to code in VB, but am willing to use a code that someone provides.

Thanks in advance for any help that you can offer. Please let me know if you need more details.
 
Last edited:

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
UPDATE: Here's a better "picture" of my data.

Signatory-----SOP#-------- SOP_Title--------- SOP_Approval------Name1----Name2------Name3
________----M4001---------Guidance-----------2/1/2012---------Linda------Troy-------Donnie
________----M4021---------Operations---------3/1/2012---------Linda------Troy-------Donnie
________----M4065---------Tests--------------4/1/2012---------Linda------Troy-------Donnie
________----M4107---------Hazards------------5/1/2012---------Linda------Troy-------Donnie


I'm getting closer.

I found the following VB script that will put in one name automatically:

Code:
Sub Do_Until()
x = 2
y = 5
Do Until Cells(x, 2) = ""
Cells(x, 1) = Cells(x, 5)
x = x + 1
y = y + 1
Loop
End Sub

This script will put the name "Linda" in all cells in Col A until Col B is blank. What I need it to do is to fill in the first name, then repeat all of the data (Cols B thru D) with the next name until the names run out. The final result should look something like this:

Signatory-----SOP#-------- SOP_Title--------- SOP_Approval
Linda--------M4001---------Guidance-----------2/1/2012
Linda--------M4021---------Operations---------3/1/2012
Linda--------M4065---------Tests--------------4/1/2012
Linda--------M4107---------Hazards------------5/1/2012
Troy--------M4001---------Guidance-----------2/1/2012
Troy--------M4021---------Operations---------3/1/2012
Troy--------M4065---------Tests--------------4/1/2012
Troy--------M4107---------Hazards------------5/1/2012
Donnie------M4001---------Guidance-----------2/1/2012
Donnie------M4021---------Operations---------3/1/2012
Donnie------M4065---------Tests--------------4/1/2012
Donnie------M4107---------Hazards------------5/1/2012

Hopefully that makes things clearer. Thanks!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,222,828
Messages
6,168,484
Members
452,193
Latest member
Arlochorim

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top