edmoor
Inventaris
- Lid geworden
- 8 sep 2000
- Berichten
- 39.754
- Besturingssysteem
- Windows XP, 7, 10, 11-23H2
- Office versie
- Office 365
Exporteer je dat van de website of download je daar dat document? Wat er gebeurt is overigens correct en komt, zoals al eerder genoemd, omdat die datum niet is voorzien van de eeuw informatie. Excel weet dan niet dat het gaat om een Amerikaans datum formaat en interpreteert deze als een Europese datum. Dat komt dan weer omdat Windows op je PC als standaard de NL datum notatie gebruikt.
Dit zet het voor je om:
Dit zet het voor je om:
Code:
Sub AdateToEdate()
Dim sDate As String
Dim LastRow As Long
Dim i As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
End With
For i = 1 To LastRow
If IsDate(Cells(i, 2)) Then
sDate = Format(Cells(i, 2), "DD-MM-YYYY")
Cells(i, 2) = DateValue(Right(sDate, 2) & "-" & Format(Cells(i, 2), "MM") & "-20" & Left(sDate, 2))
End If
Next
End Sub
Laatst bewerkt: