Create Mail Merge with Grouping a Key Field from Excel (VBA)

I have a large Database with the following info.

(Example 4 columns, each column separated with |, and replaced email with / )

[login to view URL] | Email | Product | Q |

SH1 | info/[login to view URL] | Orange | 105.566 |

SH1 |info/[login to view URL] | Berries | 200.000 |

BT1 |info/[login to view URL] | Orange | 300.000 |

BT4 |info/[login to view URL] | Apple | 101.700 |

WT1 |info/[login to view URL] | Berries | 201.040 |

WT6 | info/[login to view URL] | Apple | 204.000 |

[login to view URL] refers to Company_Name, and Q for quantity.

I need a mail merge that inserts an exclusive table using a key field to form the table.

In the dummy table before, the key field could be the company name, or the company mail.

For example


from <hendrixspirit/[login to view URL]>

To: <emailcompany1>

Subject: Enquiry of <productname1>, <productname2>, ..., <productnamei>

Dear sirs from <company_name1>

In name of Hendrix Fundation, I'm requesting a price quotation and

availability of the following products so we can feed the people that is going to conmemorate

50 years of WoodStock Festival.

!-- Here it has to insert an specific table for the company name

!-- so it only shows the information regarding that company.!


| Product | Q |

| Product 1 | Q. Prod 1 |

| Product 2 | Q. Prod 2 |

| Product ... | Q. Prod ...|

| Product i | Q. Prod i |


Hendrix Foundation Supply Manager

<end mail, and repeat for other company,

until there are no more companies..>

I've tried to do this with Word Mail Merge to Outlook using an Excel datasheet with a small dummy database.

I've found a page of microsoft support (en-us/kb/294686), but I have only been partialy succesfull: I can insert the data, but:

1) I can't add text after and showing it in the correct way, and two and more importat. I can't add a format of table that "changes".

I have a large database with varied data points and variables which will require many emails. I need a system that can handle this load.

To clarify: I need to Mail merge and insert an specific table regarding a Key Field** (in the dummy case the key field is they company_name or the company_email).

I'm fluent in SQL queries, use Microsoft SQL Server as the database, but I preffer to export the info from the SQL to an excel and the do the mail-merge.

I don't want to use SQL connections because i expect that people that don't use SQL would be able to use it at my office to.

Also bonus points if it's possible to attack a .pdf file to the mail merge (always the same file to each mail)

My expected solutions in order from better to worse.

1) a VBA "Macro" or code that provides what I'm asking

2) A Google Apps application that do the same but with Google SpreadSheet, google form, etc (we have google apps for work at the office.

2) Download a paid program that could do this. But I haven't been able to find it.

So to clarify for last time.

1) Grab information from a database with the format given before, and INSERT a table in the middle of the e-mail with the fields that are relevant for.

For example for SH1 the table would be:

| Orange | 105.566 |

| Berries | 200.000 |

But for BT1 it would be only one line:

| Orange | 300.000 |

Hipotetically there could be a company with infinite products, and also there could be infinite columns

for example (Product, Type, Price, Quantity)

| Orange | |Clementine | 5 USD |105.566 |

| Orange | Mandarine | 7 USD |55.566 |

I have program things on VBA and i know it's possible, but i'm not a programmer so i get lost on how to make the three programs talk togheter (Excel for Database, Word for template of Mail, Outlook for sending the e-mail).

I can provide dummy datasheet and clear example if needed. I also asked on stackoverflow with no answer, and had search in the web for some weeks and haven't found anything similar :S

I've added a dummy database on .xls that clarifies the project. This was asked for some freelancers. Hope that with this information you can provide your best offer.

Compétences : Excel, Microsoft Outlook, Visual Basic pour les apps , Word

en voir plus : vba excel mail merge, create microsoft server sbs, excel vba mail merge word document excel macro, game development, excel, visual basic, vb.net, unity 3d, visual basic for apps, microsoft excel, excel vba excel macro mail merge word, word mail merge excel vba, vba mail merge excel word, vba create mail merge, mail merge pdf excel vba, excel database built links create mail merge pdfs, mail merge create pdf vba, mail merge template create email, word vba create mail merge, vba mail merge excel 2010 word 2010

Concernant l'employeur :
( 1 commentaire ) Santiago, Chile

Nº du projet : #11504036

Décerné à:


Hello, my name is Cristian, I have a degree in Business and work with excel every day. I have much experience with spreadsheets, formulas, models and macros. Check my reviews. They speak for themselves. PS: I can Plus

%selectedBids___i_sum_sub_7% %project_currencyDetails_sign_sub_8% USD en 5 jours
(196 Commentaires)

17 freelance font une offre moyenne de $152 pour ce travail


Hi Sir, I have gone through the requirements and I can write the required VBA script within 2 days. I am ready to accept payment, after you have tested the functionality. Please discuss so I may begin working on it. Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 2 jours
(102 Commentaires)

Dear Project Poster, I have relevant hands on 5 years of experience .We have a team of all the skills. I assure you about the work quality and time delivery. Please give me chance to complete this project. I Have Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 2 jours
(234 Commentaires)

Hi, I am an Excel VBA expert and would be happy to take on your project. My solution is going to be Excel VBA based meeting your requirements. Regards, Arul

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(229 Commentaires)

Hello there, I reviewed the requirements in detail and as you rightly mentioned, this needs some custom macro programming to be done. I would like to inform you that I have done almost similar setups for other cl Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 7 jours
(128 Commentaires)

Hello. 40 % of employers hiring me once hired me again. I have experience in the same. I CAN do this job, and do it well!

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(111 Commentaires)

HI I am an excel-vba Expert and I have done a similar project for my own company I can finish your project so fast start chat to discuss more ....................................................................... Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 5 jours
(37 Commentaires)

- I have expertise in Excel automation, Outlook mailing and modifying the content, and Word automation. - Have done sending / modifiying the incoming mails and resending based on information, sending mails from Excel Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 4 jours
(44 Commentaires)

Hi Mr. Employer, Glad to contact with you. I can do this project through effective manner with 100% accuracy fulfilled your requirements. I assured that i have provide you 24/7 communication support during the projec Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(61 Commentaires)

Hi, Experienced Excel VBA and VB.Net Programmer. Expertise in exchanging data between sheets, advance formulas, critical programming, developing system for management and creating reports. I have read your ins Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(49 Commentaires)
%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(67 Commentaires)

Will do this one for a good review! Professional work, in time, with ZERO errors, for sure! We aim to be your one stop solution for ALL IT needs, and provide a 100% SATISFACTION GUARANTEE. We do not charge you, if y Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 2 jours
(20 Commentaires)

Hi, I've already done some VBA similar to this project, involving sending automated email from a text/word file. I've also do a lot of VBA for Excel automation, so I could do this project for you (including the atta Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(7 Commentaires)

Hello. Understand, how to do this job. Skills in VBA, experiance of working in word, excel, access. No problem with this job and those tasks from discription.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 5 jours
(5 Commentaires)

Can fulfill your requirement in a day. I am an excel guru and have worked on similar projects in past.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(2 Commentaires)

Hi, I am professional in this task.I would like to assist you in your projects. Get it done professionally get it done right the 1st time. I am here to make long term relationship. I would like to get all details from Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(0 Commentaires)

Hi there, I am confident; I can take up your project and do it with perfection. I have excellent communication skills with over 10 years experience in data entry. I can use ms-excel spreadsheet to compute any type Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(0 Commentaires)