Hello. I have a bit of code below fron Ron deBruin that e-mails from excel.
In column A of the excel sheet, I have a timestamp of changes. Each row is
for a specific person, with their e-mail address in column E. This code
will be scheduled to run at midnight every night. What I would like is for
this code to e-mail everyone in the list where the timestamp is today -
basically email eveyone whos information has changes today. So I think it
sounds like some sort of For Next statement? Thanks!
Dim iMsg As Object
Dim iConf As Object
Dim cell As Range
Dim var As Range
Dim strbody As String
Application.ScreenUpdating = False
If IsEmpty(Cells(ActiveCell.Row, "M")) Then
strbody = "You are not authorized to charge against any PO's"
Set var = Range(Cells(ActiveCell.Row, "M"), _
For Each cell In var
desc = Application.VLookup(cell.Value, Range("A1500:B2000"), 2, 0)
If IsError(desc) Then
sStr1 = ""
sStr1 = " - " & desc
strbody = strbody & cell.Value & sStr1 & vbNewLine
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
..Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
..Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
Set iMsg = CreateObject("CDO.Message")
Set .Configuration = iConf
.To = Sheets("HR DB").Cells(ActiveCell.Row, "E").Value
.From = """Me"""
.Subject = "Test"
.textBody = strbody
Set iMsg = Nothing
Set iConf = Nothing
Application.ScreenUpdating = True
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Search Engine Friendly URLs by vBSEO 3.6.0 RC 1