+ Reply to Thread
Results 1 to 13 of 13

Email Specific Cell Values When Cell in Row is Changed to "Yes"

  1. #1
    Registered User
    Join Date
    02-05-2019
    Location
    St. Louis, MO
    MS-Off Ver
    365
    Posts
    13

    Email Specific Cell Values When Cell in Row is Changed to "Yes"

    I need to have the attached spreadsheet automatically send an email when a cell in the range is changed to "Yes".

    I've been able to get the email to send, but I cannot figure out how to get values from other cells in the row of the changed cell to the email body and subject.

    When Column L is changed to "Yes" the email should automatically send to an email with the subject: *Column A Value* "ready to schedule processing training."

    Body should include: *Column A Value*", CO:"*Column B Value* "is ready to schedule training for the switch to online processing. Your contact is *Column K Value* and their next processing date is" *Column M Value*.

    Please let me know if you need any other information.

    Thank you in advance!
    Last edited by Paul; 09-26-2019 at 01:17 PM. Reason: Removed attached file due to contents (sensitive/private information).

  2. #2
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Email Specific Cell Values When Cell in Row is Changed to "Yes"

    You need to pass the row number of the changed cell in from the Change event to the email proc. Then just use it to retrieve the data in the various columns on the same row.
    i.e. change this:
    Please Login or Register  to view this content.
    to something like this:
    Please Login or Register  to view this content.
    and change this:
    Please Login or Register  to view this content.
    to something like this:
    Please Login or Register  to view this content.
    and use that to retrieve your data and construct your message.
    MM.
    MatrixMan.
    --------------------------------------
    If this - or any - reply helps you, remember to say thanks by clicking on *Add Reputation.
    If your issue is now resolved, remember to mark as solved - click Thread Tools at top right of thread.

  3. #3
    Registered User
    Join Date
    02-05-2019
    Location
    St. Louis, MO
    MS-Off Ver
    365
    Posts
    13

    Re: Email Specific Cell Values When Cell in Row is Changed to "Yes"

    Thank you! Are you able to give me an example of how I would pull this? I'm a little turned around because its not as simple as pulling A1 for example. I have followed your directions thus far.
    Last edited by kreiner2006; 05-05-2019 at 06:18 PM. Reason: Updating that I have followed the directions.

  4. #4
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Email Specific Cell Values When Cell in Row is Changed to "Yes"

    Try this:
    Please Login or Register  to view this content.
    MM

  5. #5
    Registered User
    Join Date
    02-05-2019
    Location
    St. Louis, MO
    MS-Off Ver
    365
    Posts
    13

    Re: Email Specific Cell Values When Cell in Row is Changed to "Yes"

    Thank you! I've used your suggestion and when I test, I see outlook open up on my taskbar, but the email is not coming through to the inbox. I did get the email with my earlier version.


    As for the question of why "On Error Resume Next" is there, I can't tell you. I got the example from another site. I am unable to post the link.

  6. #6
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Email Specific Cell Values When Cell in Row is Changed to "Yes"

    I don't know why this line:
    Please Login or Register  to view this content.
    ... is not generating an error for you. xMailBody is a string not an object.

  7. #7
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Email Specific Cell Values When Cell in Row is Changed to "Yes"

    What happens when you step through the code line by line?

  8. #8
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Email Specific Cell Values When Cell in Row is Changed to "Yes"

    This is working for me ...
    Please Login or Register  to view this content.
    What happens at your end?

  9. #9
    Registered User
    Join Date
    02-05-2019
    Location
    St. Louis, MO
    MS-Off Ver
    365
    Posts
    13

    Re: Email Specific Cell Values When Cell in Row is Changed to "Yes"

    This just worked! I am bowing down to the VBA god!

  10. #10
    Forum Contributor
    Join Date
    02-29-2012
    Location
    UK, Newcastle
    MS-Off Ver
    Office 365
    Posts
    131

    Re: Email Specific Cell Values When Cell in Row is Changed to "Yes"

    Hi, this looks like it could be what i am looking for. Can i ask how the routine is triggered? Is there a macro that runs it as soon as the work book is opened?
    In my workbook i will add data to say cells A1 to A5. A5 would automatically add todays date when say cell A4 is updated. Ideally i would like the routine to take the data in A1:A5 and email it when A5 is updated.
    However I have no problem in creating a new cell where i update it to YES for the routine to run.

    Any help appreciated.

  11. #11
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Email Specific Cell Values When Cell in Row is Changed to "Yes"

    You could trigger it using a Worksheet_Change event; test for the cells you want to be complete and, when they are, call the sub.

  12. #12
    Forum Contributor
    Join Date
    02-29-2012
    Location
    UK, Newcastle
    MS-Off Ver
    Office 365
    Posts
    131

    Re: Email Specific Cell Values When Cell in Row is Changed to "Yes"

    Quote Originally Posted by MatrixMan View Post
    You could trigger it using a Worksheet_Change event; test for the cells you want to be complete and, when they are, call the sub.
    Hi MM, yes i am looking at this now, although still struggling with it. I may be back for further advice if I may :-)

  13. #13
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Email Specific Cell Values When Cell in Row is Changed to "Yes"

    Sure - no problem. Although this is a closed thread marked complete and a little off topic for your specific question so I suggest you start a new thread if you have questions about event macros.

+ 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. Replies: 3
    Last Post: 05-02-2019, 02:18 PM
  2. [SOLVED] Identify specific numeric values in a cell such as "1" without counting "11" as two "1"s
    By MHanna39 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-03-2019, 01:35 PM
  3. VBA to create a "note" or a few sentences based on specific cell values.
    By Nerfmagnet in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-07-2016, 02:31 PM
  4. Copying specific cells based on cell value "P" or "O" to sht1 or sht2
    By Ity007 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-01-2016, 07:53 AM
  5. Replies: 3
    Last Post: 06-05-2015, 01:55 PM
  6. Replies: 3
    Last Post: 01-29-2015, 02:36 PM
  7. Displaying Multiple "IF" Condition Values Into One Specific Cell
    By BigFeat in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-05-2005, 08:12 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