Results 1 to 13 of 13

Several persons initials in one cell, sent to their respective e-mail addresses.

Threaded View

Lacessit Several persons initials in... 09-13-2012, 09:17 AM
wallyeye Re: Several persons initials... 09-13-2012, 12:43 PM
Lacessit Re: Several persons initials... 09-14-2012, 03:17 AM
Lacessit Re: Several persons initials... 09-14-2012, 03:50 AM
wallyeye Re: Several persons initials... 09-14-2012, 11:42 AM
Lacessit Re: Several persons initials... 09-17-2012, 02:43 AM
wallyeye Re: Several persons initials... 09-18-2012, 06:17 PM
Lacessit Re: Several persons initials... 09-19-2012, 02:34 AM
Lacessit Re: Several persons initials... 09-25-2012, 05:33 AM
wallyeye Re: Several persons initials... 09-25-2012, 12:05 PM
Lacessit Re: Several persons initials... 09-26-2012, 07:07 AM
wallyeye Re: Several persons initials... 09-28-2012, 01:45 PM
Lacessit Re: Several persons initials... 10-01-2012, 02:38 AM
  1. #1
    Registered User
    Join Date
    09-13-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    11

    Several persons initials in one cell, sent to their respective e-mail addresses.

    I have been using the code below to send e-mails based on dates (props to paul) when the workbook is opened. What I can't figure out to do it to enter several initials into cell i,12 and have their respective e-mail addresses added to the "Strto" Value.

    Example: J.D and D.J are held within an i,12 cell. I would like these to correspond to John.doe@gmail.com and doe.john@gmail.com.

    Private Sub Workbook_Open()
    Dim i As Long
    Dim OutApp As Object
    Dim OutMail As Object
    Dim strto As String, strcc As String, strbcc As String
    Dim strsub As String, strbody As String
        
        For i = 6 To Sheets("FMEA").Range("B65536").End(xlUp).Row
            If Sheets("FMEA").Cells(i, 13).Value = (Date) Then
                Set OutApp = CreateObject("Outlook.Application")
                OutApp.Session.Logon
                Set OutMail = OutApp.CreateItem(0)
            
                strto = Sheets("FMEA").Cells(i, 12).Value
                'strcc = Sheets("FMEA").Cells(i, 13).Value & _
                            "; " & Sheets("FMEA").Cells(i, 5).Value
                strbcc = ""
                strsub = "Contract Expiry Notice"
                strbody = "Hi there" & vbNewLine & vbNewLine & _
                    "Your contract, " & Sheets("FMEA").Cells(i, 11).Value & _
                    ", is due to expire on " & Sheets("FMEA").Cells(i, 13).Value & _
                    ". Please contact us at your earliest convenience." & _
                    vbCrLf & vbCrLf & "Thank you."
        
                With OutMail
                    .To = strto
                    .CC = strcc
                    .BCC = strbcc
                    .Subject = strsub
                    .Body = strbody
                    .Send
                End With
        
                Set OutMail = Nothing
                Set OutApp = Nothing
            End If
        Next i
    End Sub
    Thanks a bunch,

    Lacessit
    Last edited by JosephP; 09-26-2012 at 07:10 AM. Reason: corrected code tags

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