1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| Public Function Verif(Expression)
Verif = false
Mots = Split(Expression, " ")
NombreMots = Ubound(Mots) - LBound(Mots) + 1
'Nombre de mots
if NombreMots <> 4 Then Exit function
'Taille Nom
if len(Mots(0)) < 3 Then Exit function
'Casse Nom
if ucase(Mots(0)) <> Mots(0) Then Exit function
'Taille Prénom
if len(Mots(1)) < 3 Then Exit function
'Casse Prénom
if ucase(left(Mots(1),1)) < left(Mots(1),1) Then Exit function
'Tiret
if Mots(2) <> "-" Then Exit function
'Taille Service
if len(Mots(3)) < 3 Then Exit function
'Casse Service
if ucase(Mots(3)) <> Mots(3) Then Exit function
Verif = True
end function |
Partager