Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
1656to1660
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

DTPicker übernimmt nicht das Datum

DTPicker übernimmt nicht das Datum
27.11.2018 17:19:27
Magda
Hallo zusammen,
ich habe das Problem das mir leider aus der UserForm mit dem DTPicker nicht das Datum übernommen wird in die Email oder in die Excel Liste es zeigt immer 00:00:00 an.
Ich wäre sehr Dankbar für Hilfe, ich komme hier einfach nicht weiter.
Hier mein Code:

Private Sub CommandButton1_Click()
If TextBox2 = "" Then
MsgBox "Bitte ---- eintragen!"
TextBox2.SetFocus
Exit Sub
Exit Sub
End If
Unload Me
Dim APP_OUTLOOK As Object
Dim MESSAGE As Object
Set APP_OUTLOOK = CreateObject("Outlook.Application")
Set MESSAGE = APP_OUTLOOK.CreateItem(0)
With MESSAGE
.To = "XXXXXX"
.Subject = "XXX" & " " & TextBox5 & " " & TextBox2 & " " & TextBox6
.Body = "XXXX" & "  =  " & ComboBox1 & vbCrLf & " Auftrag" & "  =  " & TextBox1 & vbCrLf &  _
_
_
"Maschinen" & _
"  =  " & ComboBox2 & vbCrLf & " *** " & "  =  " & TextBox2 & vbCrLf & "XXX" & "  =  " &    _
_
_
TextBox3 & vbCrLf & "XXX" & "  =  " _
& DTPicker1 & vbCrLf & "XXX" & "  =  " & DTPicker1 & vbCrLf & "XXXX" & "  =  " & TextBox4
.Display
End With
Dim Lngzeile As Long
Dim Boxen As String
With Worksheets(1)
Lngzeile = Cells(.Rows.Count, 3).End(xlUp).Row + 1
Boxen = "xxxx " & ComboBox1 & ",Auftrag: " & TextBox1 & ",xxxx: " & ComboBox2 & "xxx: " & _
_
_
_
TextBox2 & ",xxx: " & TextBox3 & ",Lieferdatum: " & DTPicker1 & ",xxx: " & DTPicker2 & ", _
_
_
xxx: " & TextBox4
Cells(Lngzeile, 4) = Boxen
Cells(Lngzeile, 3) = "Banf"
Cells(Lngzeile, 5) = Date
End With
Unload Banf
Set APP_OUTLOOK = Nothing
Set MESSAGE = Nothing

Private Sub UserForm_Initialize()
DTPicker1.Value = Date
DTPicker2.Value = Date
End Sub

2
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: DTPicker übernimmt nicht das Datum
27.11.2018 21:21:14
Werner
Hallo Magda,
Date = Datum, ohne Uhrzeit
wenn du die Ausgabezelle z.B. im Format TT.MM.JJJJ HH:MM formatierst, dann bekommst du als Ausgabe das aktuelle Datum und als Uhrzeit 00:00
Versuch mal hier statt
DTPicker1.Value = Date
DTPicker2.Value = Date

das
DTPicker1.Value = Now
DTPicker2.Value = Now
Kann es aber nicht testen, habe keinen DTPicker.
Gruß Werner
AW: DTPicker übernimmt nicht das Datum
28.11.2018 10:30:34
Magda
Hallo Werner,
leider hat es keine Änderung ergeben.
Die Ausgabe ist immer noch :
Lieferdatum: 00:00:00,Ausfallmustertermin: 00:00:00
In der UserForm wird das Datum angezeigt, aber sobald es in meine Excel Datei und in Email kommen soll wird 00:00:00 als Datum angezeigt.
Gruß Magda
Anzeige

Links zu Excel-Dialogen

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige