Clever-Excel-Forum

Normale Version: Datumswerte in Excel ändern
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
Hallo zusammen,

ich habe aus einer DB folgende Datumswerte erhalten:

Apr. 25.2023 12:00 Europe/Berlin

Ich möchte das Datum in 25.04.2023 ändern. Mit "Zelle formatieren" klappt es nicht.

Danke.

LG
Arielle
Ich habe mir die Daten aus einer csv.Datei geholt und kann das Datum nicht ändern. (Siehe Beispiel Exceltabelle)

Wie bekomme ich das Datum in TT.MM.JJJJ hin?

Bitte um Hilfe.

Danke.
Hallo Arielle

[attachment=49515]

Gruss Guschti
Hallo Arielle2, Guschtis Formel klappt natürlich, aber falls du auf deinem Rechner auch Libreoffice-Calc hast, geht das noch einen Tick einfacher:
In LO-Calc genügt Suchen von "Europe/Berlin" und das Feld Ersetzen leer lassen und schwupps wird daraus das Datum im Format "TT.MM.JJJJ.
Gruß Helmut
Hallo,

hier ein Code, der nur kleine Ergänzungen benötigt:

Code:
Sub CSV_Datum()
Dim Datum As Date, Zeit As Date, Ar, CList
Dim Mon As Integer, Tag As Integer, Jahr As Integer

CList = Application.GetCustomListContents(3)
'Debug.Print i, Join(CList, ",")

For i = 2 To 24
    Ar = Split(Cells(i, 1))
    For m = 1 To 12
        If Ar(0) = CList(m) Then
            'Debug.Print m, CList(m)
            Mon = m
            Exit For
        End If
    Next m
    Datum = DateSerial(CInt(Split(Ar(1), ".")(1)), m, CInt(Split(Ar(1), ".")(0)))
    
    Cells(i, 2) = Datum
    Zeit = DateValue(Ar(2))
    Cells(i, 3) = CDate(Ar(2))
    Cells(i, 3).NumberFormat = "h:mm"
Next i
End Sub

mfg


@helwagemi
Excel schafft das auch:

zuerst " Europe/Berlin" löschen, dann

Code:
Sub ohne_Europe()
For i = 2 To 24
    Cells(i, 7) = CDate(Cells(i, 6))
Next i
End Sub
PHP-Code:
=DATE(MID(A2;8;4);INT(FIND(LEFT(A2;3);"  JanFebMärAprMayJunJulAugSepOktNovDec")/3);MID(A2;5;2))