Quick question : macro email text

dwilson38550m

Board Regular
Joined
Nov 21, 2005
Messages
89
Hi,

I have a macro I use to distribute an email attachment and screen shot to a defined emails user list (noted on cell U9 and U10) - this works Ok but is there a way I can add a fixed text field at the start of the email so the user know what this is about?

"Please find attached some information you find useful about xxxxxxxxxxxxxxxx"

Do I need to add something below .Subject

Thanks
David
------------------------------------------------------------------------

Sub emailsnap()
'
' emailsnap Macro
'

Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Charts")

Dim si As Worksheet
Set si = ThisWorkbook.Sheets("Summary N")

Dim lr As Integer
lr = sh.Range("A" & Application.Rows.Count).End(xlUp).Row

sh.Range("A1:r92" & lr).Select

With Selection.Parent.MailEnvelope.Item
.to = sh.Range("U9").Value
.cc = sh.Range("U10").Value
.Subject = sh.Range("U11").Value
.attachments.Add "C:\Bank\Bank Balances Master DW New DW.xlsm"
.send

End With

'
End Sub
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Try something like:
Code:
Sub emailsnap()'
' emailsnap Macro
'


Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Charts")


Dim si As Worksheet
Set si = ThisWorkbook.Sheets("Summary N")


Dim lr As Integer
lr = sh.Range("A" & Application.Rows.Count).End(xlUp).Row


Dim MyMessage As String


MyMessage = "This is text that goes to the body of the email" & vbNewLine & "and here's another line of text."


sh.Range("A1:r92" & lr).Select


With Selection.Parent.MailEnvelope.Item
    .to = sh.Range("U9").Value
    .cc = sh.Range("U10").Value
    .Subject = sh.Range("U11").Value
    .Body = MyMessage
    .attachments.Add "C:\Bank\Bank Balances Master DW New DW.xlsm"
    .Display
End With




End Sub
 
Upvote 0

Forum statistics

Threads
1,214,385
Messages
6,119,209
Members
448,874
Latest member
b1step2far

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