Remind me to send an email10/18/2023 ![]() ![]() Now, go back to your sheet and run the Macro named SendEmail01 as it is the name of your current Macro.After that, we define Subject, Email_To, Cc, Bcc, Email_Text as the necessary parts of an Email by a With Statement.Also, we use Single_Mail to create an item for Email_Obj. Then we create an Outlook Application Object which we define by Email_Obj.Cc and Bcc refer to Carbon Copy and Blind Carbon Copy of the Email that we wish to send to different people. Otherwise, we put some more variables in a new IF Statement. If there is no Email address ( Email_To= “”), the Sub Procedure will exit. ![]() After that, we use Value in a VBA IF Statement and also set Subject, Email_From and Email_To to an InputBox.Then we set Range_Select to an InputBox where it can select a range of cells via a Message Box.First, we declared some necessary variables: Range_Select and Date_Range as Range Cell_Address, Subject, Email_From, Email_To, Cc, Bcc, Email_Text as String Email_Obj and Single_Mail as Object.Set Single_Mail = Email_Obj.CreateItem(0) Set Email_Obj = CreateObject("Outlook.Application") Subject = Application.InputBox("Subject: ", "Message",, ,, ,, 2)Įmail_From = Application.InputBox("Send from: ", "Message Box",, ,, ,, 2)Įmail_To = Application.InputBox("Send to: ", "Message Box",, ,, ,, 2)Ĭc = Application.InputBox("CC: ", "Message Box",, ,, ,, 2)īcc = Application.InputBox("BCC: ", "Message Box",, ,, ,, 2)Įmail_Text = Application.InputBox("Message Body: ", "Message Box",, ,, ,, 2) Set Range_Select = Application.InputBox("Select a range:", _ Type the following code in the VBA Module.ĭim Subject, Email_From, Email_To, Cc, Bcc, Email_Text As StringĬell_Address =.In this section, we will only work with the dates. Let’s go through the process below for a better understanding. You can make a list of dates when you want to send the Emails to their corresponding recipients. We can send an Email automatically by using the Microsoft Visual Basic for Application ( VBA) based on dates. Using Excel VBA to Automatically Send Email Based on a Fixed Date 3 Ways to Automatically Send Email from Excel Based on Date 1. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |