Send Email using VBA : Copy data from excel to assigned table in the email template.

Muhamed Faizal

Board Regular
Joined
Aug 18, 2011
Messages
204
Hi,

I have created a macro that sends emails to multiple people. This macro opens an email template from my computer local drive then copies data from a filtered range in excel and paste in a specific location of the email template. I was using the following code to specify the exact location to paste the data in the email template.

VBA Code:
Range("C4").SpecialCells(xlCellTypeVisible).Copy
wdDoc.Range(700,700).Paste


It was working fine till my client modify the email template. Now the new email template is designed with table. The macro needs to copy data from excel then paste it to one of the table cells in the email template. Using the above method I am unable to select the exact location. Data is getting paste at the end of the table in the email template. Is there a way I can paste the data inside a table in the email template?

Appreciate your time on solving this problem

Thanks
Faizal
 

Some videos you may like

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Watch MrExcel Video

Forum statistics

Threads
1,118,294
Messages
5,571,379
Members
412,385
Latest member
OChambo94
Top