Datumsformat von Text in Datum
08.08.2022 14:46:05
Text
ich versuche schon eine ganze weile eine Spalte mit einer Auswahl Dropdown Datum in eine neue Tabelle zu kopieren und dies als Datumsformat zu hinterlegen.
Da die kopierte Spalte mit Dropdown mit kopiert wird, ist das als Text und nicht als Datumsformat.
Wie bekomme ich die kopierte Spalte Datum mit dem Dropdown weg, sodass nur das Datumsformat ausgegeben wird?
Vielen Dank im Voraus.
Sub kopieren()
Dim ws1 As Worksheet: Set ws1 = Sheets("Tabelle1")
Dim ws2 As Worksheet: Set ws2 = Sheets("Tabelle2")
Dim lastrow1 As Long, lastrow2 As Long
lastrow1 = ws1.Range("B" & Rows.Count).End(xlUp).Row
lastrow2 = ws2.Range("A" & Rows.Count).End(xlUp).Row
ws1.Range("B2:K" & lastrow1).Copy Destination:=ws2.Range("A" & lastrow2).Offset(1, 0)
ws2.Range("A" & lastrow2).Value = DateValue(ws2.Range("A" & lastrow2).Offset(1, 0).Value)
ws2.Range("K" & lastrow2 + 1).Value = Now
End Sub