Upload
sanooksanan
View
241
Download
6
Embed Size (px)
DESCRIPTION
How to Send Email Reminder Automatically
Citation preview
12/12/2014 HowtosendemailreminderautomaticallyfromExcelWorksheetusingVBA|ExcelVBATrainingVideos
data:text/htmlcharset=utf8,%3Cheader%20class%3D%22entryheader%22%20style%3D%22margin%3A%200px%200px%201.714285714rem%3B%20paddi 1/2
HowtosendemailreminderautomaticallyfromExcelWorksheetusingVBA
4Replies
OurYouTubevideo:HowtocreatenotificationsorremindersinExcelbecamequitepopular.PeoplenowwanttoknowhowtoreadoutthemessageSendReminderandthecreditcardnumber.TheVBAcodebelowdescribeshowtoachievethespeakcellsfeatureinMSExcel:PrivateSubWorkbook_Open()ForEachcellInRange(B2:B5)Ifcell.Value
12/12/2014 HowtosendemailreminderautomaticallyfromExcelWorksheetusingVBA|ExcelVBATrainingVideos
data:text/htmlcharset=utf8,%3Cheader%20class%3D%22entryheader%22%20style%3D%22margin%3A%200px%200px%201.714285714rem%3B%20paddi 2/2
TheclickontheabovecommandbuttonactivatesthespeakcellsfeatureandalsocallsanothermacroorsubroutinecalledSendReminderMail.ThecompleteVBAcodeforthismacroisgivenbelow:
SubSendReminderMail()DimOutLookAppAsObjectDimOutLookMailItemAsObjectDimiCounterAsIntegerDimMailDestAsString
SetOutLookApp=CreateObject(Outlook.application)SetOutLookMailItem=OutLookApp.CreateItem(0)
WithOutLookMailItemMailDest=ForiCounter=1ToWorksheetFunction.CountA(Columns(4))IfMailDest=AndCells(iCounter,4).Offset(0,1)=SendReminderThenMailDest=Cells(iCounter,4).ValueElseIfMailDestAndCells(iCounter,4).Offset(0,1)=SendReminderThenMailDest=MailDest&&Cells(iCounter,4).ValueEndIfNextiCounter
.BCC=MailDest
.Subject=FYI
.Body=Reminder:Yournextcreditcardpaymentisdue.Pleaseignoreifalreadypaid.
.SendEndWith
SetOutLookMailItem=NothingSetOutLookApp=NothingEndSub