+ Reply to Thread
Results 1 to 7 of 7

Send an email based on a cells value

  1. #1
    Forum Contributor
    Join Date
    01-13-2016
    Location
    Sheffield, England
    MS-Off Ver
    2016
    Posts
    216

    Send an email based on a cells value

    Hi All,

    I have a worksheet that when a cell in column F is changed I want to email out a message to a particular person.
    I.E. if the cell in F is changed to Production I want to email Chris Smith with a message letting him know that he has a new Non Conformance that needs actioning.
    If the cell in F is changed to Survey I want to email Lee Ashton with the same message etc etc.

    I am reasonably new to VBA and not sure on the coding that is required to do this

  2. #2
    Forum Contributor
    Join Date
    03-28-2018
    Location
    Houston, TX
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    127

    Re: Send an email based on a cells value

    shina,

    Paste this code in the worksheet. You can get to the worksheet code by right-clicking the tab you want to run this for, and then clicking "View Code". I'm not sure how many people you want to send e-mails to. If it's a lot of people, I would suggest creating a list of triggers, e-mail addresses, subject lines, and body text in a worksheet and then referencing that using the code. The way I have the code now, it requires you to add e-mail addresses and such anytime a new person is added or removed. However, I tested this and it does what you need. You will need to look at the code and modify the e-mail addresses, subjects, and bodies. Let me know if you have any questions.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    01-13-2016
    Location
    Sheffield, England
    MS-Off Ver
    2016
    Posts
    216
    Quote Originally Posted by brant.wheeler View Post
    shina,

    Paste this code in the worksheet. You can get to the worksheet code by right-clicking the tab you want to run this for, and then clicking "View Code". I'm not sure how many people you want to send e-mails to. If it's a lot of people, I would suggest creating a list of triggers, e-mail addresses, subject lines, and body text in a worksheet and then referencing that using the code. The way I have the code now, it requires you to add e-mail addresses and such anytime a new person is added or removed. However, I tested this and it does what you need. You will need to look at the code and modify the e-mail addresses, subjects, and bodies. Let me know if you have any questions.

    Please Login or Register  to view this content.
    Thanks Brant. I will try this in the morning when I get to work. Sorry for my stupid question but body would be the message I want to send.

  4. #4
    Forum Contributor
    Join Date
    03-28-2018
    Location
    Houston, TX
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    127

    Re: Send an email based on a cells value

    Yes. There are 3 things really:
    1) Email Address
    2) Subject - the title of the e-mail
    3) Body - the more descriptive message you want to send

  5. #5
    Forum Contributor
    Join Date
    01-13-2016
    Location
    Sheffield, England
    MS-Off Ver
    2016
    Posts
    216
    Quote Originally Posted by brant.wheeler View Post
    Yes. There are 3 things really:
    1) Email Address
    2) Subject - the title of the e-mail
    3) Body - the more descriptive message you want to send
    What if I wanted to cc someone on the email. Sorry to be a pain

  6. #6
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Send an email based on a cells value

    Cross-posted at: https://www.mrexcel.com/forum/genera...lls-value.html
    Please read Excel Forum's Cross-Posting policy in rule 8: http://www.excelforum.com/forum-rule...rum-rules.html
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  7. #7
    Registered User
    Join Date
    01-03-2019
    Location
    na
    MS-Off Ver
    2016
    Posts
    4

    Re: Send an email based on a cells value

    Thank you for this helpful link and it works a treat are you able to specify a range i.e. cells b100:b150 for example?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. send email based on cell value
    By Jamesraywebber85 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-19-2018, 03:19 PM
  2. Excel to send email to two addresses in two cells? MSG box upon send?
    By sdyer02 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-15-2016, 08:22 PM
  3. Send email based on date value
    By Billie Mac in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-10-2016, 07:56 AM
  4. Workflow with signatures (if cell=x then send email, if signed then send email)
    By Kate2811 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-25-2014, 05:37 AM
  5. Send email based on record
    By 24simpson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-18-2012, 02:44 PM
  6. Replies: 6
    Last Post: 12-02-2011, 02:14 PM
  7. send email with email addresses in a range of cells
    By Craig in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-10-2005, 05:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1