我有此代码可以根据单元格 a 中的更改发送和发送电子邮件,但是我希望在电子邮件正文中包含其他单元格的内容,以便更具体地为最终用户定位问题。我想不出针对我想要的特定细胞的最佳方法。任何帮助,将不胜感激!
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect([A2:A1000], Target) Is Nothing Then
Set olApp = CreateObject("Outlook.application")
Set M = olApp.CreateItem(olMailItem)
Dim rngTo As Range
Dim rngBody As Range
Dim objOutlook As Object
Dim objMail As Object
Dim Issues As String
Dim Desc As String
Issues = Target.row
With ActiveSheet
'here is where i'm trying to get the contents of "F"
Desc = Range("F" & Issues)
Set rngBody = Intersect([A2:A1000], Target)
End With
rngBody.Copy
With M
.Subject = "Issue Tracker Has Changed"
.Body = "The Status of Your Issue" & Desc & " Has Changed to " & rngBody
.Recipients.Add "jane.doe@whatever.org"
.Send
End With
End If
End Sub