+ Reply to Thread
Results 1 to 2 of 2

Macro to send emails from excel using filters

Hybrid View

  1. #1
    Registered User
    Join Date
    03-11-2013
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2010
    Posts
    97

    Macro to send emails from excel using filters

    Hi All

    I am looking for a macro where it send emails automatically from my excel using the following filters

     Send emails to the Contact name wherever
    - Completion DT is blank ,
    - Vendor tier Risk level is not Low
    - Submit date is not Blank,
    - Comments are blank
    - Duplicate is blank
    sample test - macro to send emails with multiple filters.xlsx

    I have highlight the columns (blue color) where email needs to be sent from excel basing on the above filters

     Should send mails from kiran_kurapati777@yahoo.com
     update with the Date in th the mail Sent Date column as soon as mail is sent.
     Post which automatically Save the file “Training_Followup_Done_Date” on desktop
     Once the file is save…. A Message box should pop up saying “Task Completed”
     After the 7 days of running a macro a reminder mail should be sent to kiran_kurapati777@yahoo.com Saying “Kindly check for updates in the Training follow up project”
    Thank you for all your support

    Regards
    Kiran Kumar

  2. #2
    Registered User
    Join Date
    03-11-2013
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Macro to send emails from excel using filters

    Here we go.... got a solution

    Sub Mail()
    '
    ' Macro1 Macro
    '
    
    '
        Range("D5").Select
      Do Until Selection.Offset.Value = ""
          If Selection.Offset.Value <> "Low" Then
         ActiveCell.Offset(0, 1).Select
        If Selection.Offset.Value <> "" Then
          Selection.Offset(0, 7).Select
          If Selection.Offset.Value = "" Then
          Selection.Offset(0, 1).Select
          If Selection.Offset.Value = "" Then
          Selection.Offset(0, 1).Select
           If Selection.Offset.Value = "" Then
          Selection.Offset(0, 1).Select
          A = ActiveCell.Value
             Set OutApp = CreateObject("Outlook.Application")
        Set OutMail = OutApp.CreateItem(0)
    
        On Error Resume Next
       ' Change the mail address and subject in the macro before you run it.
        With OutMail
        .sentonbehalfofname = A
        ActiveCell.Offset(0, -4).Select
            .To = ActiveCell.Value
            .CC = ""
            .BCC = ""
             .Subject = "Training file"
            .Close olSave
          ActiveCell.Offset(0, 11).Select
          strbdy = "Dear " & vbCrLf & "<br><br>As per our records, write your body here <br>" & vbCrLf & "<br>"
          strbdy1 = "change of paragraph <br>" & vbCrLf & "<br>"
          strbdy2 = "Do write to us with your questions and Queries at xyz@abc.com. Thanks!!" & "<br><br>Regards<br>XYZ Team <br>" & vbCrLf & "<br>"
            .htmlBody = strbdy & strbdy1 & strbdy2
            .Save
            .Send
             End With
        On Error GoTo 0
    
        Set OutMail = Nothing
        Set OutApp = Nothing
        
        ActiveCell.Offset(0, 5).Select
        ActiveCell.FormulaR1C1 = Now
        ActiveCell.Offset(0, -2).Select
          End If
          Selection.Offset(0, -1).Select
          End If
          Selection.Offset(0, -1).Select
          End If
          Selection.Offset(0, -7).Select
          End If
           Selection.Offset(0, -1).Select
          End If
        Selection.Offset(1, 0).Select
        Loop
         ActiveWorkbook.SaveAs Filename:= _
            "C:\Users\xyz\Desktop\xlm.xlsm", FileFormat:= _
            xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
        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. [SOLVED] Macro To Send Emails with PDF: Multiple Emails and PDF's
    By totoga12 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-19-2014, 06:13 PM
  2. Excel macro that will send emails from outlook
    By terreese in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-13-2014, 11:57 AM
  3. Macro – send emails to lotus notes via excel
    By sunilwadhwa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-20-2012, 05:43 AM
  4. [SOLVED] Need Macro that will create & send emails w/ attachments from a list in Excel
    By rollerden in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2012, 07:02 PM
  5. Sending macro emails using excel: Send emails with their passwords.
    By loveisblind in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2009, 03:16 PM

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