這是我認爲可能是一個堅實的開始。您顯然必須解決該郵件應該發送到哪個電子郵件地址以及如何格式化正文以及其他內容。
r給出的範圍取決於您提供的樣本數據,它佔據了A2-A4,但將其更改爲任何正確的數據。
Option Explicit
Sub email()
Dim r As Range
Dim cell As Range
Set r = Range("A2:A4")
For Each cell In r
If cell.Value = Date Then
Dim Email_Subject, Email_Send_From, Email_Send_To, _
Email_Cc, Email_Bcc, Email_Body As String
Dim Mail_Object, Mail_Single As Variant
Email_Subject = "subject"
Email_Send_From = "[email protected]"
Email_Send_To = "[email protected]"
Email_Cc = "[email protected]"
Email_Bcc = "[email protected]"
Email_Body = "body"
On Error GoTo debugs
Set Mail_Object = CreateObject("Outlook.Application")
Set Mail_Single = Mail_Object.CreateItem(0)
With Mail_Single
.Subject = Email_Subject
.To = Email_Send_To
.cc = Email_Cc
.BCC = Email_Bcc
.Body = Email_Body
.send
End With
End If
Next
Exit Sub
debugs:
If Err.Description <> "" Then MsgBox Err.Description
End Sub
謝謝,這太棒了!但是,您是否知道如何將電子郵件正文中的計劃,調用和Notes單元的引用?現在,它只會發送一封電子郵件,其中包含我爲「body」所分配的任何文本。 –
我沒有時間編輯我的代碼(對不起!),但我會使用索引來跟蹤您所在的行,然後您可以從其他列中獲取適當的數據。祝你好運! – Dportology
Upvote!任何有用的答案應該是upvoted,爲了海報! –