Forum Discussion

Aprile's avatar
Aprile
Copper Contributor
Jan 21, 2025

Email to be sent when a content is entered in a cell in Excel

Is it possible to set up an automated email notification when a specific cell in an Excel spreadsheet is updated?

I'm responsible for tracking reimbursements for expense reports for a number of employees, some will have reimbursements for out-of-pocket expenses. Can I set up an automated email notification that will tell me when they enter data in "a cell" and also tell me in the body of the email.

The name of the person on the report (this info is in a particular cell in the report).

The date of the report (this info is in a particular cell in the report).

Note: Each employee completes their expense report and will have their own separate Excel Expense Report.

If I can do this then I will not have to look through every report to find the few with Out-Of-Pocket expenses to be reimbursed.

5 Replies

  • NikolinoDE's avatar
    NikolinoDE
    Platinum Contributor

    Maybe you can use VBA to monitor changes in certain cells and trigger an email via Outlook.

    I haven't tried it, but here's an approach. Since I haven't tried the code, please save your file first to be on the safe side.

    Private Sub Worksheet_Change(ByVal Target As Range)
        Dim KeyCells As Range
        Dim MyEmail As Object
        
        ' Specify the cell to monitor (update this as per your needs)
        Set KeyCells = Me.Range("B2") ' Change B2 to the cell you want to monitor
    
        If Not Application.Intersect(KeyCells, Target) Is Nothing Then
            ' Get relevant data from the worksheet
            Dim Name As String
            Dim DateOfReport As String
            Dim OutOfPocketExpenses As String
            
            Name = Me.Range("A1").Value ' Cell where employee name is stored
            DateOfReport = Me.Range("A2").Value ' Cell for date of report
            OutOfPocketExpenses = KeyCells.Value ' Updated cell value
    
            ' Prepare email
            Set MyEmail = CreateObject("Outlook.Application").CreateItem(0)
            With MyEmail
                .To = "email address removed for privacy reasons" ' Replace with your email
                .Subject = "Out-of-Pocket Expense Update"
                .Body = "Employee Name: " & Name & vbCrLf & _
                        "Report Date: " & DateOfReport & vbCrLf & _
                        "Out-of-Pocket Expenses: " & OutOfPocketExpenses
                .Send ' Or use .Display to preview before sending
            End With
        End If
    End Sub

    Hope this helps you...if not, just ignore it.

  • peiyezhu's avatar
    peiyezhu
    Bronze Contributor

    formula

    =HYPERLINK("mailto:email address removed for privacy reasons?subject=Mail from our Website","new")

    or send by

    =webservice("http://e.anyoupin.cn/eh3/?send2~email address removed for privacy reasons~title remider~my workbook has been updatede.anyoupin.cn.")

    =if(a2="New",webservice("http://e.anyoupin.cn/eh3/?send2~your email address~title remider~New message.","keep")


    Outlook
    Private Sub Worksheet_Change(ByVal Target As Range)

        Dim KeyCells As Range

        Set KeyCells = Range("A1")

    If Not Application.Intersect(KeyCells, Range(Target.Address)) _

               Is Nothing Then

    If Range("A1") = "New" Or Range("A1") = "Exit/Term" Then

    Dim MyEmail As MailItem

    Set MyEmail = Application.CreateItem(olMailItem)

    With MyEmail

    .To = "<type your recipient email address/ess here>"

    .Subject = "<type the subject of your email here>"

    .Body = "<type the email message text here>"

    .BodyFormat = olFormatHTML

    .Display

    .Send

    End With

    End If

    End If

    End Sub

  • Patrick2788's avatar
    Patrick2788
    Silver Contributor

    If you have access to PowerAutomate you  might look into using a flow to complete this task.

  • There's no straightforward way in Excel to do this. For example, there's no "Alert me on cell changes" feature.  There are a few ways that I think you could do it.

    Maybe the email part isn't important. You could create a workbook for yourself and use Power Query to gather all the data from the expense reports that you can review periodically. Assuming you know where the employees are saving their reports, and you have a way to detect when you're missing some data, you would not need to look through every report. Power Query would allow you to filter down to just the out-of-pocket expenses, assuming the format of the reports is consistent.

Resources