+ Reply to Thread
Results 1 to 4 of 4

Created Fields and Auto Emailing

Hybrid View

  1. #1
    Registered User
    Join Date
    12-06-2024
    Location
    Maiden, NC
    MS-Off Ver
    Microsoft 365 Enterprise
    Posts
    2

    Question Created Fields and Auto Emailing

    I have a contacts spreadsheet that I would like to do a couple of things:

    1 When a date is added to a LastContacted field, I want to populate a new field for a 30 day follow up.
    2 When the follow up date is today, I would like to send an automated email reminder to the correct person for follow up.

    Can anyone help me with the coding for this?

    Thanks in advance!

    Amy

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,405

    Re: Created Fields and Auto Emailing

    Post a sample of your workbook with 10 rows of example data. DO NOT post an image of your worksheet ... we can't work with an image. Thanks.

  3. #3
    Registered User
    Join Date
    12-06-2024
    Location
    Maiden, NC
    MS-Off Ver
    Microsoft 365 Enterprise
    Posts
    2

    Re: Created Fields and Auto Emailing

    Please see attached. Thanks!
    Attached Files Attached Files

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,405

    Re: Created Fields and Auto Emailing

    Private Sub Worksheet_Change(ByVal Target As Range)
        Dim rng As Range
        Dim cell As Range
        Dim OutApp As Object
        Dim OutMail As Object
        Dim emailBody As String
        Dim currentRow As Range
        Dim emailList As Collection
        Dim emailAddress As Variant
        
        Set rng = Intersect(Target, Me.Columns("O").SpecialCells(xlCellTypeConstants))
        Application.ScreenUpdating = False
        Application.Calculation = xlCalculationManual
        
        On Error Resume Next
        
        If Not rng Is Nothing Then
            Set emailList = New Collection
            
            For Each cell In rng
                If IsDate(cell.Value) Then
                    cell.Offset(0, 1).Value = DateAdd("d", 30, Date)
                    emailAddress = cell.Offset(0, -8).Value
                    
                    If Not IsEmpty(emailAddress) Then
                        emailList.Add emailAddress
                    End If
                End If
            Next cell
            
            If emailList.Count > 0 Then
                Set OutApp = CreateObject("Outlook.Application")
                
                With Sheets("Sheet1")
                    For Each emailAddress In emailList
                        Set OutMail = OutApp.CreateItem(0)
                        Set currentRow = .Rows(ActiveCell.Row)
                        emailBody = ""
                        
                        
                        For Each cell In currentRow.Cells
                            emailBody = emailBody & cell.Value & "  "
                        Next cell
                        
                        With OutMail
                            .To = emailAddress
                            .Subject = "Date Entry Notification"
                            .Body = emailBody
                            '.Send
                            .Display
                        End With
                        
                        Set OutMail = Nothing
                    Next emailAddress
                End With
                Set OutApp = Nothing
            End If
        End If
        
        Application.Calculation = xlCalculationAutomatic
        Application.ScreenUpdating = True
    End Sub
    Attached Files Attached Files

+ 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. Replies: 1
    Last Post: 08-21-2018, 10:46 AM
  2. [SOLVED] Auto emailing in the BCC column
    By tnewell2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-11-2013, 05:07 PM
  3. Auto Emailing Macro needs fix
    By kiranpat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-29-2012, 12:48 PM
  4. Auto Emailing
    By tek9step in forum Outlook Formatting & Functions
    Replies: 2
    Last Post: 06-29-2009, 06:48 AM
  5. Help Modifying a form created with VBA (4 new fields)
    By simjambra in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-13-2009, 12:24 PM
  6. Excel SHOULD NOT AUTO-CHANGE formated text fields to DATE FIELDS!
    By PSSSD in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-08-2006, 04:35 PM
  7. Replies: 0
    Last Post: 05-03-2006, 02:00 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