VBA Code to e-mail selection syntax

victoria2207

New Member
Joined
Mar 9, 2018
Messages
17
Good Afternoon, I have tailored the following code to enable me to e-mail a selection in my workbook to specified people at the push of a button:

With ActiveSheet.MailEnvelope
.Introduction = "These are the items Due or Late for Calibration - please review your items and confirm they have been actioned."
.Item.To = "email1@outlook.com;e-mail2@outlook.com"
.Item.Subject = "Calibration Items Due"
.Item.Send
End With

However, the list of e-mail addresses could be different as could the introduction. Is it possible to reference the text within a cell as the Introduction text and a cell which contains the full list of e-mail receipients rather than entering the e-mail addresses/text directly into the VBA code?

TIA

Vic2207
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Let's assume that A2 contains the introduction, and that B2 contains your list of email recipients, try...

Code:
With ActiveSheet.MailEnvelope
    .Introduction = Range("A2").Value
    .Item.To = Range("B2").Value
    .Item.Subject = "Calibration Items Due"
    .Item.Send
End With

Hope this helps!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,713
Messages
6,174,043
Members
452,542
Latest member
Bricklin

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