Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27

Thread: Excel Template With Macro For Sending Mails And Attachment Through Outlook

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Jun 2013
    Posts
    3
    Rep Power
    0
    Thank you bakerman, this script is exactly what I'm looking for.

    I'm having a problem though in that if I copy a range of cells from another sheet to a blank row, the script triggers regardless of whether or not "OK" is in the targeted cell in the column. How can I modify the script to ONLY trigger when "OK" is typed into the targeted cells?

    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    https://eileenslounge.com/viewtopic.php?p=326972#p326972
    https://eileenslounge.com/viewtopic.php?p=326853#p326853
    https://eileenslounge.com/viewtopic.php?p=326446#p326446
    https://eileenslounge.com/viewtopic.php?f=27&t=41986
    https://eileenslounge.com/viewtopic.php?p=325610#p325610
    https://eileenslounge.com/viewtopic.php?p=325609#p325609
    https://eileenslounge.com/viewtopic.php?p=325605#p325605
    https://eileenslounge.com/viewtopic.php?p=325548#p325548
    https://eileenslounge.com/viewtopic.php?p=316441#p316441
    https://eileenslounge.com/viewtopic.php?p=324736#p324736
    https://eileenslounge.com/viewtopic.php?p=324990#p324990
    https://eileenslounge.com/viewtopic.php?f=27&t=41937&p=325485#p325485
    https://eileenslounge.com/viewtopic.php?p=325609#p325609
    https://eileenslounge.com/viewtopic.php?p=325610#p325610
    https://www.youtube.com/watch?v=3t8Mk4URi6g&lc=UgzoakhRXOsCaoRm_Nd4AaABAg. 8xzeMdC8IOGADdPM65i9PG
    https://www.youtube.com/watch?v=3t8Mk4URi6g&lc=UgzoakhRXOsCaoRm_Nd4AaABAg. 8xzeMdC8IOGADdPQHFk_zm
    http://www.eileenslounge.com/viewtopic.php?p=324457#p324457
    http://www.eileenslounge.com/viewtopic.php?p=324064#p324064
    http://www.eileenslounge.com/viewtopic.php?p=323960#p323960
    https://www.youtube.com/watch?v=7VwD9KuyMk4&lc=UgyZCnNfnZRfgwzDlQF4AaABAg
    https://www.youtube.com/watch?v=7VwD9KuyMk4&lc=UgyZCnNfnZRfgwzDlQF4AaABAg. ADd4m2zp_xDADd6Nnotj1C
    s://www.youtube.com/watch?v=7VwD9KuyMk4&lc=UgySdtXqcaA27wQLd1t4AaABAg
    http://www.eileenslounge.com/viewtopic.php?p=323959#p323959
    http://www.eileenslounge.com/viewtopic.php?f=30&t=41784
    http://www.eileenslounge.com/viewtopic.php?p=323966#p323966
    http://www.eileenslounge.com/viewtopic.php?p=323959#p323959
    http://www.eileenslounge.com/viewtopic.php?p=323960#p323960
    http://www.eileenslounge.com/viewtopic.php?p=323894#p323894
    http://www.eileenslounge.com/viewtopic.php?p=323843#p323843
    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    Last edited by DocAElstein; 05-25-2025 at 12:56 PM.

  2. #2
    Moderator
    Join Date
    Jul 2012
    Posts
    156
    Rep Power
    14
    Code:
    Private Sub Worksheet_Change(ByVal Target As Range)
        
        If Target.Column = 9 Then
            If UCase(Target.Value) = "OK" Then
                With CreateObject("Outlook.Application").CreateItem(0)
                    .To = Cells(Target.Row, 8).Value
                    .Subject = Cells(Target.Row, 4).Value
                    .Body = "Dear " & Cells(Target.Row, 3).Value & " " & Cells(Target.Row, 2) & "," & vbLf & vbLf & _
                        "The attachment provided is my final consultation report." & vbLf & vbLf & _
                        "Sincerely yours" & vbLf & vbLf & _
                        "Burzum"
                    .Attachments.Add Cells(Target.Row, 7).Value
                    .Display '.Send
                End With
            End If
        End If
        
    End Sub

  3. #3
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  4. #4
    Junior Member
    Join Date
    Nov 2013
    Posts
    7
    Rep Power
    0
    No, I did not, and thanks for this really cool macro! However another question came up, but I posted it in this thread you linked me.

    Thank you again!

  5. #5
    Junior Member
    Join Date
    Oct 2013
    Posts
    3
    Rep Power
    0
    This is an superb macro and I've regularly used it. Sometimes, I need to send more than one, and up to three, attachments. Is it possible to make it running the macro once?
    Thanks in advance.

  6. #6
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    Will have a look at that and get back.
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  7. #7
    Junior Member
    Join Date
    May 2015
    Posts
    1
    Rep Power
    0

    NEED TO SEND EMAIL WITH FIX COLOUR FULL BODY

    HELLO ALL,

    macro for emails sending work perfectly but now i have other problem, i have one fix table to send in all email on mail body this table is full of color.

    can please share macro that perfectly work for this kind of requirement, also attach email body in image format for your review.


    thanks in advance.
    Attached Images Attached Images

Similar Threads

  1. Replies: 6
    Last Post: 06-05-2013, 11:33 PM
  2. Replies: 4
    Last Post: 03-01-2013, 10:48 PM
  3. Replies: 7
    Last Post: 08-08-2012, 10:24 AM
  4. Replies: 7
    Last Post: 05-09-2012, 11:34 PM
  5. Replies: 3
    Last Post: 02-20-2012, 12:54 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •