VBA to Send Email Alert to Specific Person When Cell In Row is Updated

njfulton

New Member
Joined
Jul 23, 2019
Messages
4
We have a shared spreadsheet that tracks requests from customers - When a request has been filled, a value is inputted into a specific cell in that row...I'd like to try and find VBA that could send an email to that employee when one of their requests has been updated.

I've included example data below


  • When Column K (Paciolan) is updated, an email alert should be sent
  • Column I (requesting staff initials) would determine what email address the alert should be sent to (there are about 10 different staff members who submit requests)

ABCDEFGHIJKLMNO
GamePriority Location 1Priority Location 2Member IDName#PointsUpgrade?Requesting Staff InitialsRequest NotesPaciolanPriceStaff Outreach InitialsOutreach NotesResult
MiamiMain123456Example 110100NoNFExample125:Y:1-2

<tbody>
</tbody>

Here is a link to the screenshot of the spreadsheet - https://ibb.co/gFNC1Hw

I've found some information on how to receive an alert when a cell is updated, but nothing for custom alerts based on the value of another cell in that row.

Thank you so much for your help!

gFNC1Hw

 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Try this

Change data in red by your information.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  If Not Intersect(Target, Range("K:K")) Is Nothing Then
    If Target.Count > 1 Then Exit Sub
    If Target.Value = "" Then Exit Sub
    If Target.Row < 2 Then Exit Sub
    Dim eMail As String, dam As Object
    '
    'Fill email address
    Select Case Cells(Target.Row, "I").Value
[COLOR=#ff0000]      Case "ES": eMail = "es@gmail.com"[/COLOR]
[COLOR=#ff0000]      Case "NF": eMail = "nf@gmail.com"[/COLOR]
[COLOR=#ff0000]      Case "BB": eMail = "bb@gmail.com"[/COLOR]
[COLOR=#ff0000]      Case Else: eMail = "dam@gmail.com"[/COLOR]
    End Select
    Set dam = CreateObject("Outlook.Application").CreateItem(0)
    '
    'Mail Information
    dam.To = eMail
    dam.Subject = "[COLOR=#ff0000]One of their requests has been updated[/COLOR]"
    dam.Body = "[COLOR=#ff0000]Alert !!!![/COLOR]"
    dam.Display 'use [COLOR=#0000ff].Send to send[/COLOR]
  End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,202
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top