Hallo zusammen
Ich will mir den Wert einer Zelle (P43) welche das format h/mm hat, in ein mail schreiben lassen. Zudem das aktuelle Sheet als pdf anhängen. (das klappt bereits).
Leider bring ich das Uhrzeit format nicht hin.. :-(
Public Sub SendWorkSheetToPDF()
Dim Wb As Workbook
Dim rng As Range
Dim FileName As String
Dim OutlookApp As Object
Dim OutlookMail As Object
On Error Resume Next
Set Wb = Application.ActiveWorkbook
FileName = Wb.FullName
xIndex = VBA.InStrRev(FileName, ".")
If xIndex > 1 Then FileName = VBA.Left(FileName, xIndex - 1)
FileName = FileName & "_" + ActiveSheet.Name & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=FileName
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
With OutlookMail
.To = "mailadresse"
.CC = "mailadresse"
.BCC = ""
.Subject = "Arbeitszeit_Stark_Roger_2016" & "_" + ActiveSheet.Name & ".pdf"
.Body = "Hallo.." & vbCrLf & "Der Saldo des letzten Monats beträgt:" & ActiveSheet.Range("P43") & vbCrLf & "Im Anhang findest du die ganze Übersicht des letzten Monats" & vbCrLf & "Gruess" & vbCrLf & "Roger"
.Attachments.Add FileName
'.Send
.Display
End With
Kill FileName
Set OutlookMail = Nothing
Set OutlookApp = Nothing
End Sub
wir bringe ich den Wert von Zelle P43 als h/mm ins mail?
|