cs_PROGRAMMIX
Messages postés1133Date d'inscriptionmercredi 2 octobre 2002StatutMembreDernière intervention24 juillet 20112 13 janv. 2003 à 20:15
Dim indexListe as integer
Dim débutMot as string
Dim longueurMot as integer
débutMot = "Mai"
longueurMot = Len(débutMot)
For indexListe = 0 To MaListe.ListCount -1
If Ucase(Left(MaListe.List(indexListe), longueurMot) = Ucase (débutMot) Then
'CODE LORSQU'ON A TROUVE
(...)
Exit For
End If
Next
'SI ON ARRIVE ICI, AUCUN MOT NE CORRESPOND AU CRITERE DE RECHERCHE
cs_PROGRAMMIX
Messages postés1133Date d'inscriptionmercredi 2 octobre 2002StatutMembreDernière intervention24 juillet 20112 13 janv. 2003 à 20:17
Oups... Mon commentaire après la boucle est erroné puisque je fais un Exit For, mieux vaudrait un Exit Sub ou Exit Function en fonction des besoins du code.