+ Reply to Thread
Results 1 to 5 of 5

Subject line reference 3 cells and omit someone from being an email sender

  1. #1
    Registered User
    Join Date
    05-22-2022
    Location
    Texas City, TX
    MS-Off Ver
    2016
    Posts
    30

    Subject line reference 3 cells and omit someone from being an email sender

    I have an Excel spreadsheet that auto saves and sends an email when closing the spreadsheet.

    I have two problems at the moment.

    1) I would like the subject line in an auto send email to reference three different cells. (F1, E2 and D3 are the locations)

    2) I would like the ability to remove 2 users from sending the auto email (Outlook). There's 4 of us total that will access the spreadsheet, but only 2 of us need to send the auto email, the other 2 will review and audit there work, thus an auto email is not necessary.

    Any help would be greatly appreciated.
    Thanks

  2. #2
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,367

    Re: Subject line reference 3 cells and omit someone from being an email sender

    Put the usernames, who has to send automated mails, in the array in line one

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-22-2022
    Location
    Texas City, TX
    MS-Off Ver
    2016
    Posts
    30

    Re: Subject line reference 3 cells and omit someone from being an email sender

    I'm sorry, but I am slightly confused on the code you provided.
    (Environ("username"), Array("User1", "User2")
    The users that will be sending the email when the spreadsheet closes are Forklift1 and Operator1,
    But what goes in the "username"

    Thanks for the help

  4. #4
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,367

    Re: Subject line reference 3 cells and omit someone from being an email sender

    Place both names in the array instead of User1 and User2.
    That?s it

  5. #5
    Registered User
    Join Date
    05-22-2022
    Location
    Texas City, TX
    MS-Off Ver
    2016
    Posts
    30

    Re: Subject line reference 3 cells and omit someone from being an email sender

    Here's the current coding I have in place for the emails... I'm puzzled at how to integrate your code into it. Sorry, but could you help clarify for me.

    Public Sub SendEmail()

    Dim emailApplication As Object
    Dim emailItem As Object

    Set emailApplication = CreateObject("Outlook.Application")
    Set emailItem = emailApplication.createitem(0)

    emailItem.to = "email address"
    emailItem.cc = "email address"
    emailItem.Subject = Join(Array([F1], [E2], [E3]))
    emailItem.body = "Draft Shop Records Spreadsheet"
    emailItem.Attachments.Add ThisWorkbook.FullName
    emailItem.Send

    Set emailItem = Nothing
    Set emailApplication = Nothing

    End Sub

+ 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. Opening .Xls Attachement from Email based on Subject/Sender
    By lougs7 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-09-2020, 05:26 AM
  2. [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
  3. Replies: 0
    Last Post: 02-11-2019, 08:45 AM
  4. How to change email file from Subject to Sender's email address?
    By london7871 in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 09-25-2017, 11:13 PM
  5. Outlook Macro to save mail attachment from a specific sender with subject line
    By manoj.0790 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-17-2016, 09:34 AM
  6. Forward Email Based on Selected Object's Subject and/or Sender and Recipient Address
    By Citanaf in forum Outlook Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2015, 07:38 PM
  7. [SOLVED] Create macro to send worksheet as body of email using cells as subject line
    By LindaABH in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-16-2012, 07:43 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