Voilà le code de la fonction qui me permet de séparer une chaine de caractères
Public Function SpAmeliore(Chaine As String, PosN1 As Integer, PosN2 As Integer)
'Function split a 1 ou 2 niveaux
'1- a un niveau lorsque PosN2 = 0
'2- a 2 niveaux lorque PosN2 >= 1
'ex :
'si chaine = "a1$b1#a2$b2#a3$b3"
'spameliore(chaine,1,1) rend "a1"
'spameliore(chaine,1,0) rend "a1$b1"
'spameliore(chaine,2,2) rend "b2"
Dim DataP1
Dim Tableau1() As String
Tableau1() = Split(Chaine, "#", -1)
DataP1 = Tableau1(PosN1 - 1)
If PosN2 = 0 Then SpAmeliore = DataP1: Exit Function
Dim Tableau2() As String
Tableau2() = Split(DataP1, "$", -1)
SpAmeliore = Tableau2(PosN2 - 1)
End Function