2
12/12/2014 How to send email reminder automatically from Excel Worksheet using VBA | Excel VBA Training Videos data:text/html;charset=utf8,%3Cheader%20class%3D%22entryheader%22%20style%3D%22margin%3A%200px%200px%201.714285714rem%3B%20paddi… 1/2 How to send email reminder automatically from Excel Worksheet using VBA 4 Replies Our YouTube video: How to create notifications or reminders in Excel became quite popular. People now want to know how to read out the message ‘Send Reminder’ and the credit card number. The VBA code below describes how to achieve the speak cells feature in MS Excel: Private Sub Workbook_Open() For Each cell In Range(“B2:B5″) If cell.Value < Date + 3 And cell.Value <> “” Then cell.Interior.ColorIndex = 3 cell.Font.ColorIndex = 2 cell.Font.Bold = True Application.Speech.Speak (“Send reminder”) End If Next End Sub Private Sub CommandButton1_Click() For Each cell In Range(“B2:B5″) If cell.Value < Date + 3 And cell.Value <> “” Then cell.Interior.ColorIndex = 3 cell.Font.ColorIndex = 2 cell.Font.Bold = True Application.Speech.Speak (“send reminder to”) ‘cell.Value = cell.Offset(0, 1).Value Application.Speech.Speak (cell.Offset(0, 1).Value) End If ‘ Application.Speech.Speak (“cell.text”) Next SendReminderMail End Sub

How to Send Email Reminder Automatically From Excel Worksheet Using VBA _ Excel VBA Training Videos

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