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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Watch MrExcel Video

Forum statistics

Threads
1,118,073
Messages
5,570,032
Members
412,306
Latest member
bobbyabradley
Top