Vba Access : Split
Résolu/Fermé
A voir également:
- Split vba access
- Split cam - Télécharger - Messagerie
- Find vba - Astuces et Solutions
- You don't have permission to access this resource ✓ - Forum Réseaux sociaux
- Pdf split and merge - Télécharger - PDF
- Incompatibilité de type vba ✓ - Forum Programmation
2 réponses
Utilisateur anonyme
Modifié par Lupin.PC4 le 26/04/2012 à 19:08
Modifié par Lupin.PC4 le 26/04/2012 à 19:08
Bonjour,
Il suffit de la créer !
Voilà une suggestion !
Cdt
Lupin
Il suffit de la créer !
Voilà une suggestion !
Option Explicit Public Function PersoSplit(ByVal pChaine As String, ByVal pCaractere As String) As Variant Dim Mot As String Dim PartieDeChaine As String Dim Longueur As Long Dim Boucle As Long Dim Indice As Long Dim Resultat() As Variant Indice = 1 Longueur = Len(pChaine) For Boucle = 1 To Longueur PartieDeChaine = Mid(pChaine, Boucle, 1) If (PartieDeChaine <> pCaractere) Then Mot = Mot & PartieDeChaine Else ReDim Preserve Resultat(Indice) Indice = (Indice + 1) Resultat(Indice - 1) = Mot Mot = "" End If Next Boucle If (Mot <> "") Then ReDim Preserve Resultat(Indice) Indice = (Indice + 1) Resultat(Indice - 1) = Mot End If PersoSplit = Resultat End Function ' Public Sub TestSplit() Dim Chaine As String Dim Bloc As Variant Dim Boucle As Long Dim Resultat As String Chaine = "25;16;45;;;87;95" Bloc = PersoSplit(Chaine, ";") For Boucle = 0 To UBound(Bloc) Resultat = Resultat & Bloc(Boucle) & vbCrLf Next Boucle MsgBox Resultat End Sub
Cdt
Lupin