Send Email at the press of a button

nparsons75

Well-known Member
Joined
Sep 23, 2013
Messages
1,254
Office Version
  1. 2016
I have a sheet that is updated daily. There are three sections that are updated. Once a section is updated I would like to press a button that will send an email out to one of three people dependant on the button or selection i make. For example, If I have update the sheet relevant to person A then I want to select person A and an email will be sent notifying them that there information has been updated. Really hope someone can help with this. Thank you.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Hi, rather than re-invent the wheel, take a look at Ron de Bruin's site. He covers most things email.
Mail from Excel with Outlook (VBA)

For instance:
Code:
Sub Mail_small_Text_Outlook()
'For Tips see: http://www.rondebruin.nl/win/winmail/Outlook/tips.htm
'Working in Office 2000-2013
    Dim OutApp As Object
    Dim OutMail As Object
    Dim strbody As String

    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)

    strbody = "Hi there" & vbNewLine & vbNewLine & _
              "This is line 1" & vbNewLine & _
              "This is line 2" & vbNewLine & _
              "This is line 3" & vbNewLine & _
              "This is line 4"

    On Error Resume Next
    With OutMail
        .To = "ron@debruin.nl"
        .CC = ""
        .BCC = ""
        .Subject = "This is the Subject line"
        .Body = strbody
        'You can add a file like this
        '.Attachments.Add ("C:\test.txt")
        .Send   'or use .Display
    End With
    On Error GoTo 0

    Set OutMail = Nothing
    Set OutApp = Nothing
End Sub

You would need to put that code in a macro module then link it to a button. Come back if you get stuck.
 
Upvote 0
Is there a way to edit the font in the sent email (make it bigger).

Also is there a way of editing the body without having to go into VBA. Auto copy text from a cell for example?
 
Upvote 0
Hi,

I think it uses whatever font you have set as default.
You could create a template and save the new size in there or you could use HTML. In which case you would need to change .Body = strBody into .HTMLBody = strBody like this other example from Ron de Bruin: Insert Outlook Signature in mail
If you want to use data from the worksheet in the body then just assign the the string to the cell contents. For example:
Code:
strBody = Worksheets("Sheet1").Range("A2").Value
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,180
Members
448,871
Latest member
hengshankouniuniu

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