+ Reply to Thread
Results 1 to 9 of 9

Conditional Hyperlink an Email List

  1. #1
    Registered User
    Join Date
    12-20-2021
    Location
    San Diego
    MS-Off Ver
    2016
    Posts
    4

    Conditional Hyperlink an Email List

    I have a tracker for individuals that are in my program. I want to create a hyperlink button that populates a 'mailto' for all individuals that are "active" only . I have 4 columns:

    A5: Last Name
    B5: First Name
    C5: Email
    D5: Data validation drop-down containing "Active", etc....


    The idea is I can click one button and outlook would populate a blast email to all of the active members, and exclude all others. How can I accomplish this?
    Attached Files Attached Files
    Last edited by flip198613; 12-21-2021 at 01:24 PM.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Conditional Hyperlink an Email List

    I do this all the time. Attach a sample workbook (with sanitized data, of course) and I 'll take a look at it for you.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    12-20-2021
    Location
    San Diego
    MS-Off Ver
    2016
    Posts
    4

    Re: Conditional Hyperlink an Email List

    Quote Originally Posted by dflak View Post
    I do this all the time. Attach a sample workbook (with sanitized data, of course) and I 'll take a look at it for you.
    I created a smaller, more manageable sample of my actual spreadsheet. In addition to emailing all "active" participants, I added a list to select (or CC) the supervisor of each "active" person. Thanks for your help in advance!

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Conditional Hyperlink an Email List

    Nothing attached. Use the Go Advanced tab and manage attachments.

  5. #5
    Registered User
    Join Date
    12-20-2021
    Location
    San Diego
    MS-Off Ver
    2016
    Posts
    4
    Quote Originally Posted by dflak View Post
    Nothing attached. Use the Go Advanced tab and manage attachments.
    I attached it to my original post above. Is it not showing on your end? This is my first time using this platform.

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Conditional Hyperlink an Email List

    My apologies, I did not go back to the original. Here is the file.

    To the extent practical, I made everything "data driven" so you should not have to get "under the hood" with the code. Everything you need is on the Mail Setup Sheet.

    Subject is the subject for the email. This subject will be used on all the emails.

    Attachments is a list of full paths to attachment separated by semicolons such as C:\Temp\File1.xlsx;C:\Temp\Document.pdf

    Mail Flag can be True or False. With TRUE the mail gets processed and sent automatically. With False, the mail is stacked up on the monitor and you can edit it before clicking the send button.

    CC is the Carbon Copy that would be sent with each email

    BCC is the Blind Carbon Copy that would be sent with each email.

    Body is the body of the mail message

    If you leave Attachments, CC or BCC blank, they will be ignored. Also you can "hard copy" these variables or you can generates them with formulas.

    I converted your table to an Excel table. Some of the many advantages of Excel tables is that the know how big they are and they automatically copy down formulas, validations, etc.

    I make use of static named ranges.

    Using names and tables makes the code easier to write and understand.

    Basically, I read the first column and if it is ACTIVE, I process it. I also look at the Include Supervisor value to "build" the TO string.

    Please Login or Register  to view this content.
    The module ModMailerMulti contains "standard code" that I wrote a while back and I plug it in whenever I need to mail something. The main code is there to feed it the variables it needs.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    12-20-2021
    Location
    San Diego
    MS-Off Ver
    2016
    Posts
    4

    Re: Conditional Hyperlink an Email List

    Wow, that is some pretty intricate stuff for my newbie eyes - very impressive. Thank you for putting so much time and effort into a response. I've been staring at it at trying to figure out what's "under the hood" so-to-speak because I have another file I was trying to hyperlink emails with, but hit a 255 character roadblock using the basic hyperlink function. I don't have much experience with this VBA type of coding; is there a simple way to understand the code enough to make changes and use it in other spreadsheets? Which line in that code points to the "TO" and which line places a button? Perhaps a color-coded version so I can follow along? I want to pull this code and paste it into the actual sheet with the needed input changes. Sorry for my lack of understanding .

  8. #8
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Conditional Hyperlink an Email List

    It was not a lot of work because way back when I developed the module for the mailer. It is in, original computer parlance, a subordinate routine to the main routine. I designed it so I could pass To, CC, BCC, Subject, etc. to it. So whenever I need to mail something, I just plug this module in and write a minimal amount of code to collect and pass the parameters to it.

    The program I wrote for you does not use hyperlinks; it uses the mailer module to have Excel talk to Outlook. Also, it was designed as a template. Almost everything is set up on the mail setup page. You can use this template to set up different mailers. You can use different lists, different mail subjects, different mail bodies, and different attachments.

    Now that I look at it, the code I provided IS specific to this application. I will give it a shot to make it more generic, so that you can fill in a table and that's all you will have to do. You may have to make some formulas on the excel side to do things like add the supervisor email. This will make it a true template that you can use for any mail application without having to know any VB code.

    Unless you've had previous coding experience, there is no simple explanation of the code. It is pretty straightforward until the if statement, that's where I add the supervisor email. I think I can "kick this upstairs" so you can handle it on the worksheet.

    Give me a day or two to play with this.

  9. #9
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Conditional Hyperlink an Email List

    I used your case as the example for a more generic version of the mailer.

    https://www.excelforum.com/tips-and-...lk-mailer.html

+ 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] Macro to Email set of cells with identified email list and subject line with outlook
    By aaron061883 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-20-2020, 01:18 PM
  2. [SOLVED] Email Macro paste image in to email and sent to list in designated range Outlook
    By aaron061883 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-12-2020, 10:51 AM
  3. Hyperlink into body of hyperlink generated email
    By jamievo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-11-2020, 01:32 PM
  4. Replies: 1
    Last Post: 12-23-2014, 07:39 PM
  5. Using Vlookup to pull hyperlink from Master Hyperlink file list.
    By theflyingnimbus in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-02-2013, 01:42 PM
  6. Replies: 1
    Last Post: 02-26-2013, 07:55 PM
  7. Replies: 20
    Last Post: 03-19-2011, 09:13 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