AW: Datum Konvertieren
Reinhard
Hi John,
so läuft sie bei mir problemlos durch für den Bereich H3:H32953
Gruß
Reinhard
Sub extra2() 'Dieses Makro ausführen
Dim Z As Range, LR As Long, n As Long
Application.ScreenUpdating = False
On Error GoTo Fehler
LR = Cells(Rows.Count, 8).End(xlUp).Row 'letzte Zeile der Spalte
For Each Z In ActiveSheet.Range("H3:H" & LR).Cells
n = n + 1
If IsNumeric(Z) = False Then
Z.Value = Datum_raus2(Z.Text, n)
Z.NumberFormat = "0.00"
End If
Next Z
MsgBox n
Application.ScreenUpdating = True
Exit Sub
Fehler:
MsgBox n
Application.ScreenUpdating = True
End Sub
Function Datum_raus2(Wert$, zei As Long)
On Error GoTo Fehler
Wert = Application.Substitute(UCase(Wert), "JAN", "01")
Wert = Application.Substitute(UCase(Wert), "FEB", "02")
Wert = Application.Substitute(UCase(Wert), "MRZ", "03")
Wert = Application.Substitute(UCase(Wert), "APR", "04")
Wert = Application.Substitute(UCase(Wert), "MAI", "05")
Wert = Application.Substitute(UCase(Wert), "JUN", "06")
Wert = Application.Substitute(UCase(Wert), "JUL", "07")
Wert = Application.Substitute(UCase(Wert), "AUG", "08")
Wert = Application.Substitute(UCase(Wert), "SEP", "09")
Wert = Application.Substitute(UCase(Wert), "OKT", "10")
Wert = Application.Substitute(UCase(Wert), "NOV", "11")
Wert = Application.Substitute(UCase(Wert), "DEZ", "12")
Wert = Application.Substitute(Wert, " ", ",")
Wert = Application.Substitute(Wert, ".", ",")
Wert = Application.Substitute(Wert, ",,", ",")
Datum_raus2 = Wert * 1
Exit Function
Fehler:
MsgBox zei
End Function