Forum

VBA to send emails ...
 
Notifications
Clear all

VBA to send emails to seperate recipients based up on filter selection

4 Posts
2 Users
0 Reactions
81 Views
(@samjones833)
Posts: 2
New Member
Topic starter
 

Hi All, 

I am currently working on an automated OTIF report. I have a tab called table, line failures and copy. I need VBA to code to send an email to different supplier emails based up on the slicer selection of the line failures tab. I need the email to say hello please see your monthly OTIF figures, I also need the pivot table in the table tab to be in the body of the email and then also attach a copy of the copy tab. The various email addresses are in the emails tab of the workbook.

 

Please feel free to ask any questions.

 

Thanks, 

Sam

 
Posted : 30/01/2021 6:42 am
(@catalinb)
Posts: 1937
Member Admin
 

Can you upload a sample file with your structure?

 
Posted : 02/02/2021 1:11 pm
(@samjones833)
Posts: 2
New Member
Topic starter
 

Hi Catalina, 

 

Attached is a sample file showing the structure. 

 

Feel free to ask anymore questions.

 

Thanks, 

Sam

 
Posted : 04/02/2021 9:42 am
(@catalinb)
Posts: 1937
Member Admin
 

Hi Sam,

Here is an example that is attaching to a new email a PDF and one of the sheets saved as a new workbook.

It also has the code to add a range from a sheet in the email HTMLBody.

Please test it and adjust it to your needs.

 
Posted : 04/02/2021 11:28 am
Share: