Results 1 to 25 of 25

Macro to send an email of specific rows

Threaded View

  1. #1
    Forum Contributor
    Join Date
    09-10-2011
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    176

    Macro to send an email of specific rows

    Hello,

    I am new to programming and looking for help in the below code.

    In the below code it opens the outlook email, getting subject & body of the mail however I am looking for certain rows which has NO in either column M, N or O to be the body of the email.

    It need to send an email to email defined in Column P of that row.

    
    Sub EmailMe()
        Dim oEmail      As Object
        Dim oMailItem   As Object
        Dim sRcpt       As String
        Dim sSbjct      As String
        Dim sMsg        As String
            
        sRcpt = "[email protected]"
        sSbjct = "Here is the network number " & Range("A1")
        sMsg = sSbjct
        
        Set oEmail = CreateObject("Outlook.Application")
        Set oMailItem = oEmail.CreateItem(olMailItem)
        
        With oMailItem
            .Recipients.Add sRcpt
            .Subject = sSbjct
            .Body = sMsg
            .Display
        End With
        
        Set oMailItem = Nothing
        Set oEmail = Nothing
    End Sub
    I hope the following code needs to be modified.

     .Body = sMsg
    Thanks in advance for your help!!

    Regards,
    Humac
    Last edited by humacdeep; 10-10-2011 at 10:41 AM.

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