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
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,224,909
Messages
6,181,672
Members
453,061
Latest member
schiefA

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