Count the number of email sent from Excel. Send the count by email.
Allow me teach you the skills in Excel that you need for business
Let me teach you the VBA that I have learn in my five years of consulting
Let’s take the frustration out of user forms
Become an Affiliate and earn 25% on Course Sales
For more help visit my website or email me at easyexcelanswers@gmail.com.
Contact me regarding customizing this template for your needs.
Click for online Excel Consulting
I am able to provide online help on your computer at a reasonable rate.
I use a Blue condenser Microphone to record my videos, here is the link
Check out Crowdcast for creating your webinars
If you need to buy Office 2019 follow
I use Tube Buddy to help promote my videos
Check them out
Follow me on Facebook
TWEET THIS VIDEO
Follow me on twitter
easyexcelanswers
IG @barbhendersonconsulting
You can help and generate a translation to you own language
*this description may contain affiliate links. When you click them, I may receive a small commission at no extra cost to you. I only recommend products and services that I’ve used or have experience with.
Code
Sub Send_email_fromexcel()
Dim edress As String
Dim subj As String
Dim message As String
Dim filename As String
Dim outlookapp As Object
Dim outlookmailitem As Object
Dim myAttachments As Object
Dim path As String
Dim attachment As String
Dim r, count As Long
r = 2
count = 0
Do While Sheet1.Cells(r, 1) not equal “”
Set outlookapp = CreateObject(“Outlook.Application”)
Set outlookmailitem = outlookapp.createitem(0)
Set myAttachments = outlookmailitem.Attachments
‘define your path for the attachment
path = “C:UsersscreaOneDriveDesktopinvoices”
edress = Sheet1.Cells(r, 1)
subj = Sheet1.Cells(r, 2)
filename = Sheet1.Cells(r, 3)
attachment = path + filename
outlookmailitem.To = edress
outlookmailitem.cc = “”
outlookmailitem.bcc = “”
outlookmailitem.Subject = subj
outlookmailitem.body = “Please find your statement attached” & vbCrLf & “Best Regards”
myAttachments.Add (attachment)
outlookmailitem.display
‘outlookmailitem.send
‘clear your email address
edress = “”
r = r + 1
count = count + 1
Loop
‘clear your fields
Set outlookapp = Nothing
Set outlookmailitem = Nothing
Set outlookapp = CreateObject(“Outlook.Application”)
Set outlookmailitem = outlookapp.createitem(0)
subj = “Total Sent” & ” ” & Date
With outlookmailitem
.To = “barbhencons@gmail.com”
.cc = “”
.bcc = “”
.Subject = subj
.body = “The total emails sent on ” & ” ” & Date & ” ” & “was” & ” ” & count
End With
outlookmailitem.display
‘outlookmailitem.send
Set outlookapp = Nothing
Set outlookmailitem = Nothing
End Sub
Watch more new videos about Excel Office | Synthesized by Mindovermetal English