xlsvbah9.1

01Attribute VB_Name = "mod1Oefeningen"
02 
03Sub Oefening1()
04 
05    Range("A4").Value = WorksheetFunction.Sum(Range("A1:A3"))
06 
07End Sub
08 
09Sub Oefening2()
10 
11    Dim strNaam As String
12    Dim strVoornaam As String
13    Dim intPositieSpatie As Integer
14     
15    strNaam = "Floris Honingbloem"
16    intPositieSpatie = InStr(1, strNaam, " ")
17    strVoornaam = Left(strNaam, intPositieSpatie - 1)
18     
19    MsgBox strVoornaam
20     
21End Sub
22 
23Sub Oefening3()
24 
25    Dim dtStart
26    Dim dtEind
27     
28    dtStart = InputBox("Geef de startdatum op")
29    dtEind = InputBox("Geef de einddatum op")
30     
31    If IsDate(dtStart) And IsDate(dtStart) Then
32        MsgBox DateDiff("d", dtStart, dtEind)
33    End If
34     
35End Sub

Download hier het bestand.