Hey all! I'm looking for some help on a VBA code that will send an email any time a cell value in range A7:A50 changes to "Expires Soon". I am not well versed in VBA's and could use a helping hand please.
Thank You.
Thank You.
Sub sendMail1A()
'Set the reference to use Outlook and the version you are using
'Use the Tools menu and References search the list for Outlook
Dim olOut As Outlook.Application
Dim olMail As MailItem
Set olOut = New Outlook.Application
Set olMail = olOut.CreateItem(olMailItem)
With olMail
.To = "Add your email address here"
.Subject = "Add your subject here"
.Body = "Add what text you want to show here"
.Display
End With
Set olMail = Nothing
Set olOut = Nothing
End Sub
Sub checkExpireSoon()
Dim aCell As Range, Rng As Range
Dim SearchFor As String
Set Rng = Range("A1:A25")
SearchFor = "Expires Soon"
For Each aCell In Rng
If InStr(1, aCell.Value, SearchFor, vbTextCompare) Then
MsgBox "Found in " & aCell.Address
End If
Next aCell
End Sub