+ Reply to Thread
Results 1 to 3 of 3

Send an email with a dynamic range of cells that differ depending on the date

  1. #1
    Registered User
    Join Date
    05-25-2017
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    2

    Unhappy Send an email with a dynamic range of cells that differ depending on the date

    Hi all,

    I have a large file that contains approximately 7k lines, with one different equipment on each row. All of these equipments have End of Service dates, and therefore can be identifiable through not only their names, but by when they will be unusable.

    I wanted to create a macro that would send an email to the recipient (email address) written in column S if the date of EOS of the equipment is within the next 30 days. Now I have been struck with the idea of optimizing my existing program by sending all equipments with the same EOS date in ONE single email, instead of sending multiple mails, each with one equipment per body. However, I have not been very successful at doing so, and despite having browsed every single possible thread there is on a dynamic range insertion to the body of an email, I have yet to find out how I can achieve that.

    I have ideas on how it could be done but I do not know whether it is virtually possible or not. I thought maybe I would have to add all of the elements that would come out from my first if statement to an array, and then dump that array in the body of an email, but that didnt work. I also tried the "HTMLtorng way", but I do not like the format of the email. I simply want to do a "Paste Values" of the content of multiple cells that have an end date within the next 30 days.

    Thank you in advance for any help,
    Clement

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Send an email with a dynamic range of cells that differ depending on the date

    The example file holds a method to copy a table into Outlook body.
    The way I would do this is autofilter your data, copy results to a tempsheet and use the code to send email. Afterwards delete temp sheet.
    Attached Files Attached Files
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    05-25-2017
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    2

    Re: Send an email with a dynamic range of cells that differ depending on the date

    Thanks for the help bakerman, I'll try to do that and come back to you later!

+ 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. [SOLVED] Send email to specific people in Range depending on result from user in an InputBox?
    By Doolski in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-16-2016, 03:16 PM
  2. Send email via VBA excel and copy and paste range of cells
    By lester.ilao in forum Excel General
    Replies: 5
    Last Post: 11-06-2014, 12:34 PM
  3. How to send the email if the date range is changing
    By anikethkulkarni@gmai in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-07-2013, 04:33 PM
  4. Send Automatic email IF certain cells are not completed by a certain date
    By 13102261 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-22-2013, 04:28 AM
  5. Replies: 5
    Last Post: 12-17-2012, 05:10 PM
  6. Send email depending on cell values in selected row
    By tandridge in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-01-2011, 10:15 AM
  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

Tags for this Thread

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