• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Send Outlook Email Based On Criteria From Excel Worksheet|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Send Outlook Email Based On Criteria From Excel Worksheet|VBA & Macros|Excel Forum|My Online Training Hub

vba course banner

Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosSend Outlook Email Based On Criteri…
sp_PrintTopic sp_TopicIcon
Send Outlook Email Based On Criteria From Excel Worksheet
Avatar
William Woodson
Mesa, AZ

New Member
Members
Level 0
Forum Posts: 1
Member Since:
March 25, 2022
sp_UserOfflineSmall Offline
1
March 25, 2022 - 3:33 pm
sp_Permalink sp_Print

Hello All!

First, let me start by saying that I'm fairly new to using VBA & Macros, and my initial search of the forum didn't return any results to address my specific issues, so any help you might give to my query would be greatly appreciated!

I have a workbook/worksheet, which I will attempt to attach here, consisting of drivers' names and various dates for when their associated credentials in four different columns have expired, are getting ready to expire or are missing.  I'm trying to automate the process of creating some kind of notification system, preferably by email using Outlook, which will send a message to the driver, his/her supervisor, and me, rather than me having to compose an email manually by comparing the conditional formatting (color-coding) I've already established in the file.  I haven't added those email address columns to this worksheet/workbook yet, because I'm trying to decide whether listing them in individual columns on the same sheet (possibly Columns O - Q), or perhaps using a VLOOKUP, or other command, might be a better way, depending on the assistance you might give me.

To complicate matters, I would really like to send emails based on several conditions, but note that the same driver might receive 4 different emails, one for each column, if the dates happen to expire at the same time or even at different times:

1) An email to drivers whose credentials in a particular area (i.e., driver license expiration date) have expired (Columns G - J); sent on the day of expiration, and then every 14 days, until the date in the file is updated to a future date.

2) An email to drivers whose credentials in those same areas expire in the current month; sent on the first day of each month.

3) An email to drivers whose credentials expire in the current week or "today;" sent on Monday of the same week.

4) It would also be beneficial to send an email to recipients for any missing information; sent every 14 days until date is no longer blank.

It should also be noted that the actual file I'll be working with is in a sharepoint library accessed via MS Teams, so it can be used by multiple people, and I would prefer that I don't have to open the workbook to run a macro for the emails to be sent.

A potential email, for an expired credential, the day it happens, might look something like this:

 

Date:  03/11/2021  Time:  04:00am

From: William Woodson <william.woodson@company.com>

To: Jacob Brown <jacob.brown@company.com>

CC: Jane Doe <Jane.Doe@company.com>; John Public <John.Public@company.com>

Subject:  REMINDER!  Your DQ File Requires Attention

Jacob:

This is just a quick reminder to let you know that, according to your DQ File records, your DRIVER LICENSE on file, which allows you to be authorized to drive company vehicles, expired today, March 11, 2021.

Please reply to this email with a copy of your current DRIVER LICENSE attached as soon as possible.

Respectfully,

Your DOT CMV Administrator

Note: This message will be repeated every 2 weeks until the credential listed above is no longer expired.

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1826
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
2
March 29, 2022 - 3:14 pm
sp_Permalink sp_Print

Hi William,

You can find code to create an email in this tutorial:

https://www.myonlinetraininghu.....th-outlook

Instead of adding an attachment, you can just use the HTMLBody property to compose the email text:

Screenshot-2022-03-29-075426.pngImage Enlarger

If you don't want to open a workbook to run a macro, what is it you want? A windows application that runs a task in the background?

We can help here with an excel based solution, so you have to open a file and run a macro.

You can connect to that SP library using power query, then run a macro to analyze the records and send emails.

https://www.myonlinetraininghu.....ower-query

sp_PlupAttachments Attachments
  • sp_PlupImage Screenshot-2022-03-29-075426.png (64 KB)
sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Orlando Menes, Atos Franzon, Louis Muti
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 218
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Blair Gallagher
Brandi Taylor
Hafiz Ihsan Qadir
Gontran Bage
adolfo casanova
Annestine Johnpulle
Priscila Campbell
Jeff Mikles
Aaron Butler
Maurice Petterlin
Forum Stats:
Groups: 3
Forums: 24
Topics: 6369
Posts: 27852

 

Member Stats:
Guest Posters: 49
Members: 32359
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.