vba - Send automated emails from Excel once date passes? -
i'm new , bad @ vba. i'm trying automate emails send reminder myself once date in column f has expired (ex. today>f4). want body of email contents in column e (in same row column f date expired, ex. e4).
i cannot life of me figure out.
thanks!
**edit: i've tried run following:
sub check_tasks() dim lastrow long, r long sheets("usage") lastrow = .cells(rows.count, "a").end(xlup).row r = 2 lastrow if .cells(r, "e").value < date send_outlook_email "holdback expired:", .cells(r, "d").value, "*********@**********.com" next end end sub private sub send_outlook_email(subject string, body string, toemail string, ccemail string) dim outlookapp object 'outlook.application dim objmail object 'outlook.mailitem on error resume next set outlookapp = getobject(, "outlook.application") on error goto 0 if outlookapp nothing set outlookapp = createobject("outlook.application") set objmail = outlookapp.createitem(0) 'olmailitem objmail.subject = "holdback expried: " objmail.body = .cells(r, "d").value objmail.to = "**********@******.com" objmail.cc = "" objmail.send end sub
Comments
Post a Comment