Datumsformat umwandeln
27.05.2014 19:28:00
Heinz H
Hallo Leute im Forum
Mittels UF werden Werte & Datum im Sheet "Auswertung" eingetragen.
In Spalte "A" brauche ich von der ComboBoxDatum das Datum im Format "dd.ddd.mm.yyyy"
Nun bräuchte ich in Spalte "R" von der ComboBoxDatum das Datum im Format "mm.yyyy"
Habe Spalte "R" auch schon richtig formatiert.
Das richtige Datumsformat wird mir aber erst angezeigt wenn ich in Spalte "R" einen Doppelklick auf einen Wert mache.
Könnte mir bitte jemand helfen?
Danke,Heinz
Hier der Code
Private Sub CommandButtonEintragen_Click()
'Übernahme in Datenbank
'Worksheets("Auswertung").Activate
Dim StartZeile&
Dim Ws As Worksheet
'Set Ws = ActiveSheet
'Wenn Text oder Comboboxen leer sind
If ComboBoxLinie = "" Then
MsgBox "Es wurde keine Linie ausgewählt!"
ElseIf TextBox2 = "" Then
MsgBox "Es wurde keine Schicht ausgewählt!"
ElseIf TextBox3 = "" Then
MsgBox "Es wurde keine Schicht ausgewählt!"
ElseIf TextBoxSAP = "" Then
MsgBox "Es wurde keine SAP ausgewählt!"
ElseIf ComboBoxFehler = "" Then
MsgBox "Es wurde kein Fehler ausgewählt!"
Else
Dim liZaehler As Integer
Do Until liZaehler = CInt(Me.ComboBoxwie_oft.Text)
Set Ws = Worksheets("Auswertung")
StartZeile = Ws.Cells(65536, 1).End(xlUp).Row + 1 + BoFehler
Ws.Cells(StartZeile, 1) = Me.ComboBoxDatum 'Spalte A
Ws.Cells(StartZeile, 2) = Me.ComboBoxLinie 'Spalte B
Ws.Cells(StartZeile, 3) = Me.TextBox2 'Spalte C
Ws.Cells(StartZeile, 4) = Me.TextBox3 'Spalte D
Ws.Cells(StartZeile, 5) = Me.TextBoxSAP 'Spalte E
Ws.Cells(StartZeile, 6) = Me.TextBoxArtikelbezeichnung 'Spalte F
Ws.Cells(StartZeile, 7) = Me.TextBoxArtikelnummer 'Spalte G
Ws.Cells(StartZeile, 8) = Me.ComboBoxFehler 'Spalte H
Ws.Cells(StartZeile, 9) = Me.ComboBoxUrsache 'Spalte I
Ws.Cells(StartZeile, 10) = Me.ComboBoxGegenmaßnahme 'Spalte J
Ws.Cells(StartZeile, 11) = Me.ComboBoxWo_gefunden 'Spalte K
Ws.Cells(StartZeile, 12) = Me.ComboBoxgemeldetHE 'Spalte L
Ws.Cells(StartZeile, 13) = Me.ComboBoxVerdacht 'Spalte M
Ws.Cells(StartZeile, 14) = Me.ComboBoxKE 'Spalte N
Ws.Cells(StartZeile, 15) = Me.ComboBoxFehler_nach_Verklemmung 'Spalte O
Ws.Cells(StartZeile, 16) = Me.ComboBoxUmbau 'Spalte P
Ws.Cells(StartZeile, 17) = Me.TextBoxAnzahl_Fehler 'Spalte Q
Ws.Cells(StartZeile, 18) = Me.ComboBoxDatum 'Spalte R
liZaehler = liZaehler + 1
Loop
Fehler_eingetragen.Show
'Unload Me
Worksheets("Auswertung").UsedRange.Columns.AutoFit
'Hier wird alles nach dem Eintragen wieder geleert
TextBoxAnzahl_Fehler = ""
TextBox2 = ""
TextBox3 = ""
TextBoxSAP = ""
TextBoxArtikelbezeichnung = ""
TextBoxArtikelnummer = ""
ComboBoxLinie = ""
ComboBoxSchicht = ""
ComboBoxFehler = ""
ComboBoxUrsache = ""
ComboBoxGegenmaßnahme = ""
ComboBoxWo_gefunden = ""
ComboBoxgemeldetHE = ""
ComboBoxVerdacht = ""
ComboBoxKE = ""
ComboBoxFehler_nach_Verklemmung = ""
ComboBoxUmbau = ""
CheckBox1.Value = False
ComboBoxwie_oft = 1
'Call sortieren_datum
Application.EnableEvents = True
'ActiveWorkbook.Save
End If
ActiveWorkbook.Save
End Sub