Recuperer Chaine de mots

Bonjour voilas je voudrais récupérer une chaine de mots entres deux . (point)

I:\Albums\Commodores(The) Gold (2005)\Commodores - Natural High (1978)\Commodores - 01. Fire Girl.mp3

je voudrais récupérer Fire Girl

Merci

Bonjour

Ci joint une solution

Fred

16excel33380.xlsx (9.39 Ko)

Bonjour,

Un algorithme bien bourrin qui marche à condition que tu n'aies bien que deux points dans ta chaîne :

Sub test()
chaine = "I:\Albums\Commodores(The) Gold (2005)\Commodores - Natural High (1978)\Commodores - 01. Fire Girl.mp3"

n = Len(chaine)
k = 1
While k < n + 1
If Mid(chaine, k, 1) = "." Then
point_départ = k + 1
t = k + 1
k = n + 1
End If
k = k + 1
Wend

While t < n + 1
If Mid(chaine, t, 1) = "." Then
point_final = t
t = n + 1
End If
t = t + 1
Wend
tachaine = Mid(chaine, point_départ, point_final - point_départ)

End Sub

Re si c'est par code

voici une autre solution

Sub extract()
Dim chaine$
Dim tb
'chaine = "I:\Albums\Commodores(The) Gold (2005)\Commodores - Natural High (1978)\Commodores - 01. Fire Girl.mp3"
chaine = [A1]
tb = Split(chaine, ".")
[B1] = tb(1)
End Sub
9excel33380.xlsm (14.71 Ko)

OK merci les deux versions marchent bonne fin de journée et encor merci

Dans ce cas

Merci

Fred

Rechercher des sujets similaires à "recuperer chaine mots"