Mail bei Dateiänderung VBA
20.11.2023 16:19:08
Büromensch
ich habe diesen Code gefunden:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim xOutApp As Object
Dim xMailItem As Object
Dim xName As String
Dim xYesOrNo As Integer
On Error Resume Next
Set xOutApp = CreateObject("Outlook.Application")
Set xMailItem = xOutApp.CreateItem(0)
xYesOrNo = MsgBox("Want to attach updated workbook in email?", vbInformation + vbYesNo, "KuTools For Excel")
If xYesOrNo = 6 Then ActiveWorkbook.Save
If xYesOrNo = 6 Then xName = ActiveWorkbook.FullName
With xMailItem
.To = "Email Address"
.cc = ""
.Subject = "email notification test"
.Body = "Hi," & Chr(13) & Chr(13) & "File is now updated."
If xYesOrNo = 6 Then .Attachments.Add xName
.Display
End With
xMailItem = Nothing
xOutApp = Nothing
End Sub
Ist es möglich, diesen zu erweitern, so dass in der Mail steht, was in welcher Zelle geschrieben wurde? (Es geht immer um die Zellen A, B und C 14 und der Inhalt wird immer eine Uhrzeit).
Bin für jede Hilfe dankbar :)