Attribute VB_Name = "mod1Oefeningen" Option Explicit Sub Oefening1() Dim strBron As String Dim strRegel As String Dim arrRegel() As String Dim r As Integer strBron = ThisWorkbook.Path & "\Bronnen\Input.csv" Open strBron For Input As #1 Do r = r + 1 Line Input #1, strRegel arrRegel = Split(strRegel, ",") Debug.Print arrRegel(0) & " | " & arrRegel(1) & " | " & arrRegel(2) Loop Until EOF(1) Close #1 End Sub Sub Oefening2() Dim strBron As String Dim strRegel As String Dim arrRegel() As String Dim r As Integer strBron = ThisWorkbook.Path & "\Bronnen\Input.csv" Open strBron For Input As #1 Do r = r + 1 Line Input #1, strRegel arrRegel = Split(strRegel, ",") Cells(r, 1).Value = arrRegel(0) Cells(r, 2).Value = arrRegel(1) Cells(r, 3).Value = arrRegel(2) Loop Until EOF(1) Close #1 End Sub Sub Oefening3() Dim strBron As String Dim arrRegel() As String Dim strRegel As String Dim r As Integer strBron = ThisWorkbook.Path & "\Bronnen\Input.csv" Open strBron For Input As #1 Do r = r + 1 Line Input #1, strRegel arrRegel = Split(strRegel, ",") Cells(r, 1).Value = arrRegel(0) Cells(r, 2).Value = converteerDatum(arrRegel(1)) Cells(r, 3).Value = arrRegel(2) Loop Until EOF(1) Close #1 End Sub Function converteerDatum(Datum) As Date Dim Dag, Maand, Jaar Dag = Mid(Datum, 4, 2) Maand = Left(Datum, 2) Jaar = Right(Datum, 2) converteerDatum = FormatDateTime(Dag & "-" & Maand & "-" & Jaar) End Function
Download hier het bestand.