+ Reply to Thread
Results 1 to 4 of 4

Omitting email addresses using macro

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-04-2006
    Posts
    151

    Omitting email addresses using macro

    Hello,

    Is there a way to omit an email address based on the user who is sending the email? For instance:

    Currently I have it now where the emails are static. I use this code:
    Email = "Pbaker@bread.com; MarySmith@thesmiths.com; BobBurney@Burneys.com; Johnjohnson@johnson.com"
    But, the only issue is, if it is Mary Smith who is creating the mail, I would not want her as a recipient on the email. Same thing would go for John Johnson or any other user who works with the form. Is there any code that would exclude, or omit, the email of the sender?

    Thank you for your time

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573
    Yes, if you had some way to know who was doing the sending and what their email address was.

    You can use Application.Username to get their name from Excel or Environ("username") for their pc logon name.

  3. #3
    Forum Contributor
    Join Date
    10-04-2006
    Posts
    151
    Hi, thanks for the response.

    What would a code like your suggesting look like ?

    Note that the email addresses will have the same domain such as yahoo.com

    Unless I am way off base...
    I imagine I would have a list of email addresses, without the domain (set as variables?)where a loop could be set to check the email address (without the domain attached) and return those that do not match the environ name where the domain can then be added. I'm not real clear on how this code would be set up.

    Your time and efforts are greatly appreciated. Thank you.

  4. #4
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573
    You can do it however you like. You can hard code the date into arrays or an array or put the data in a named range in the current sheet or even an external xls or database file.

    If you put the data in the current xls file, set it up like at database so that you can use =vlookup or =match to get matches.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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