+ Reply to Thread
Results 1 to 12 of 12

Trying to reference multiple cells in an email body that satisfies a condition

  1. #1
    Registered User
    Join Date
    08-28-2020
    Location
    US
    MS-Off Ver
    2016
    Posts
    16

    Trying to reference multiple cells in an email body that satisfies a condition

    Hi, is it possible to create an automatic email that sends the person the UPC, name, size, and cost when the supply status says "running low" for multiple rows if there are multiple cells that are running low. I tried looking at a table, but I don't know how to get specific cell rows that have "running low" status.
    Attached Images Attached Images
    Last edited by Cygneous; 08-31-2020 at 04:24 PM.

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Trying to reference multiple cells in an email body that satisfies a condition

    there are a million ways to do this. what email client are you using? i'm assuming outlook?

  3. #3
    Registered User
    Join Date
    08-28-2020
    Location
    US
    MS-Off Ver
    2016
    Posts
    16

    Re: Trying to reference multiple cells in an email body that satisfies a condition

    Yes, I am using outlook

  4. #4
    Registered User
    Join Date
    08-28-2020
    Location
    US
    MS-Off Ver
    2016
    Posts
    16

    Re: Trying to reference multiple cells in an email body that satisfies a condition

    This is what I have so far:


    Please Login or Register  to view this content.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,898

    Re: Trying to reference multiple cells in an email body that satisfies a condition

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new, I have done it for you today.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Trying to reference multiple cells in an email body that satisfies a condition

    so Cygn,

    Does the code you posted actually work? does it create the mail item and send like you want it to? if so, I'm assuming all you are missing is the looping of the data and filtering the bad parts out, right?

  7. #7
    Registered User
    Join Date
    08-28-2020
    Location
    US
    MS-Off Ver
    2016
    Posts
    16

    Re: Trying to reference multiple cells in an email body that satisfies a condition

    I had to fix some things, but when I try to run this code, it gives me an error saying "object variable or with block variable not set" but the email still goes through. However, I want the email to include the UPC, name, size, and cost for the ones that are running low. Right now, it just says "Need to order more of these materials:067 Digital Rave is running low "
    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Trying to reference multiple cells in an email body that satisfies a condition

    Assuming the UPC code in in Column A, I added code to include the item from that Row in Column A. Try it out.

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    08-28-2020
    Location
    US
    MS-Off Ver
    2016
    Posts
    16

    Re: Trying to reference multiple cells in an email body that satisfies a condition

    This sends a separate email for each row in the sheet whether it's running low or not. In the end, I want it to send only 1 email, containing all the info in the row that are running low. For some reason, it won't allow me to post my code...
    Last edited by Cygneous; 08-28-2020 at 04:46 PM.

  10. #10
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Trying to reference multiple cells in an email body that satisfies a condition

    @Cygneous please post your file so we can troubleshoot further, as per the yellow banner above.

  11. #11
    Registered User
    Join Date
    08-28-2020
    Location
    US
    MS-Off Ver
    2016
    Posts
    16

    Re: Trying to reference multiple cells in an email body that satisfies a condition

    This sends an email if the status is running low, but not sure how to reference the info in the rows.
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    08-28-2020
    Location
    US
    MS-Off Ver
    2016
    Posts
    16

    Re: Trying to reference multiple cells in an email body that satisfies a condition

    This sends a seperate email for each row in the sheet whether it's running low or not

    Please Login or Register  to view this content.

+ 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 range of cells in body of an email based on time condition
    By adambor in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-03-2020, 07:57 PM
  2. Formul for most repetitive text from cells that satisfies condition
    By DarkLord76865 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-11-2018, 10:30 AM
  3. [SOLVED] Don't know how to calculate average from certain cells that satisfies condition
    By DarkLord76865 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-08-2018, 11:27 AM
  4. If condition satisfies with multiple conditions
    By excel_hunt in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-09-2014, 02:09 PM
  5. [SOLVED] Excel can send mail with multiple cells info as email body and subject, befr 3 day of due
    By ExcelUser2707 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-19-2013, 06:49 AM
  6. [SOLVED] Excel can send mail with multiple cells info as email body and subject, befr 3 day of due
    By ExcelUser2707 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-13-2013, 04:29 AM
  7. Using IF condition in email body code using VBA
    By drajanm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2013, 03:48 AM

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