Automatic e-mail

Karthikeyan Devan

Board Regular
Joined
May 5, 2009
Messages
114
Hi All,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
I need to automate an e-amid via excel which will go only to the people who are in Cell B21 and B24.<o:p></o:p>
<o:p></o:p>
Here are what I am looking for:<o:p></o:p>
<o:p></o:p>
There is a submit Command button in sheet 4. Whenever a person click on the button in sheet 4 an e-mail should go with attaching the active workbook.<o:p></o:p>
<o:p></o:p>
The e-mail should go to people whose e-mail address is listed in sheet 2, cell B21 and B24. Any help on this would be greatly appreciated.
 
Last edited:

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi,

Yes, i went through the below hyperlink earlier and i could find only to send the active workbook. Here it is little differen.

When i click on the command button in sheet 4 the active workbook should attach in the e-mail and the recipient name is listed in sheet 1 from Cell Range (B21:B24). Probably i would be overlooking in the hyperlink which you have provided. Could you please assist me on this.

Any help would be greatly appreciated!!
 
Last edited:
Upvote 0
Hi,

This will send to recipients listed in B21 and B24 only.

Code:
Sub Mail_Multiple()
Dim OutApp As Object
Dim OutMail As Object
Dim EmailSubject As String
Dim EmailSendTo As String
Dim MailBody As String
 
EmailSubject = "Test"
 
EmailSendTo = Worksheets("Sheet2").Range("B21").Value & ";" _
                    & vbCr & Worksheets("Sheet2").Range("B24").Value & " " & vbCr
 
MailBody = "see attached"
 
   Set OutApp = CreateObject("Outlook.Application")
        Set OutMail = OutApp.CreateItem(o)
        On Error Resume Next
        With OutMail
            .Subject = EmailSubject
            .To = EmailSendTo
            '.CC = ccTo
            .Body = MailBody
            .Attachments.Add ActiveWorkbook.FullName
            .Display
            '.Send
End With
    On Error GoTo 0
    Set OutMail = Nothing
    Set OutApp = Nothing
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,853
Members
452,948
Latest member
UsmanAli786

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