Hallo
Kan iemand mij helpen met de functie Initialen. De FOR i lus loopt niet juist.
Bedoeling is om uit een naam vb "axx bxx cxx dxx" enkel de beginletters samen te voegen = "abcd"
Maar er is iets foutief in de for I lus. (hier loopt het mank!!)
Alvast bedankt voor de hulp.
Hier volgt de code:
Kan iemand mij helpen met de functie Initialen. De FOR i lus loopt niet juist.
Bedoeling is om uit een naam vb "axx bxx cxx dxx" enkel de beginletters samen te voegen = "abcd"
Maar er is iets foutief in de for I lus. (hier loopt het mank!!)
Alvast bedankt voor de hulp.
Hier volgt de code:
Code:
Public Function initialen(strInput As String) As String
Dim i As Integer
Dim strOut As String
Dim strChar As String
Dim resultaat As String
i = 1
If InStr(1, strInput, " ") = 0 Then
initialen = Left(strInput, 1)
Exit Function
End If
For i = [COLOR="#FF0000"]InStr(1, strInput, " ") To Len(strInput)[/COLOR]
resultaat = resultaat & Mid(strInput, i + 1, 1)
strInput = Right(strInput, Len(strInput) - i)
Next
initialen = resultaat
End Function
Public Sub anne_initaal()
Dim xx As String
xx = initialen("axx bxxb cxx dxx")
End Sub