pcpunch
Messages postés1243Date d'inscriptionmardi 7 mai 2002StatutMembreDernière intervention18 février 20195 29 déc. 2003 à 11:07
tu remplace cette ligne
Extrait = Mid(TxtSrc, pos1% + len(départ) , pos2% - pos1%)
cs_slayer
Messages postés202Date d'inscriptiondimanche 1 septembre 2002StatutMembreDernière intervention18 mars 2008 29 déc. 2003 à 10:57
voila 2 code tous simple qui marche parfaitement bien mais si on veut recupere celement le texte entre "chat" et "méchant" on fait comment sans que "chat" et "méchant" resorte dans la selection.
pcpunch
Messages postés1243Date d'inscriptionmardi 7 mai 2002StatutMembreDernière intervention18 février 20195 29 déc. 2003 à 10:04
Voila un exemple vite fait de fonction :
Public Function Extrait(TxtSrc As String, Départ As String, Arriver As String)
pos1% = InStr(1, TxtSrc, Départ)
If pos1% = 0 Then Exit Function
pos2% = InStr(pos1%, TxtSrc, Arriver)
If pos2% = 0 Then Exit Function
Extrait = Mid(TxtSrc, pos1%, pos2% - pos1% + Len(Arriver))
End Function
Pour l'utliser !!!
Text2 = Extrait(Text1, "chat", "méchant")
29 déc. 2003 à 11:07
Extrait = Mid(TxtSrc, pos1% + len(départ) , pos2% - pos1%)
29 déc. 2003 à 10:57
29 déc. 2003 à 10:04
Public Function Extrait(TxtSrc As String, Départ As String, Arriver As String)
pos1% = InStr(1, TxtSrc, Départ)
If pos1% = 0 Then Exit Function
pos2% = InStr(pos1%, TxtSrc, Arriver)
If pos2% = 0 Then Exit Function
Extrait = Mid(TxtSrc, pos1%, pos2% - pos1% + Len(Arriver))
End Function
Pour l'utliser !!!
Text2 = Extrait(Text1, "chat", "méchant")