Hey, guys! Here's the deal: i got a sheet named "Associates" and I have a formula that, depending on the date I put, the cell turns Green/Yellow or Red. The thing is that I need to generate an email when the cell goes Yellow and another(with another message) when it's Red. So I need basically to open Outlook when the formula located on DA9 results on Y(for yellow) or R(for red). I'm a beginner at VBA and I'd really appreciate your help. Here's what I've got so far:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
If Range("DA9").Select = "Y" Then
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "Título do email"
.Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End If
End Sub
Bookmarks