VB_PtitCat
Messages postés197Date d'inscriptionmercredi 30 mai 2007StatutMembreDernière intervention13 mai 2009
-
7 févr. 2008 à 14:02
VB_PtitCat
Messages postés197Date d'inscriptionmercredi 30 mai 2007StatutMembreDernière intervention13 mai 2009
-
7 févr. 2008 à 15:16
Bonjours a vous,
Voilà en faite je cherche pour me facilité la tache au travail, un moyen de récupérer un bout de chaîne de caractère qui est passé par une fonction split().
<?xml:namespace prefix o ns "urn:schemas-microsoft-com:office:office" /??>
En effet je doit récupérer des repères dans deux feuilles EXCEL contenant a quelque détails près le même commentaire.
Je souhaite donc faire une comparaison de chaîne de caractère.
Ex :
1ère chaine : PERTE INTERCONNEXION VERS API
2ème chaine : PERTE INTERCONNEXION DE APS
Ma split() me sert à vérifier la différence entre « VERS API » et « DE APS »
je souhaite en suite comparer le début de ces chaînes afin de vérifier qu’il soient égaux, afin de recopier les lignes correspondante dans ma feuille utile.
Si quelqu’un a une idée, car moi je n’en ai pas trouvé pour le moment …
MerZi ... Zi ... Zi ... PtitCat
P.S:DSL pour l'orthographe
VB_PtitCat
Messages postés197Date d'inscriptionmercredi 30 mai 2007StatutMembreDernière intervention13 mai 2009 7 févr. 2008 à 14:21
Je vous file mon script, si ça peut vous aider un peu a m'aider ...
Private Sub CmdB_Copie_Click()
Dim li_API As Integer 'Variable de ligne API
Dim li_APS As Integer 'Variable de ligne APS
Dim li_Copie As Integer 'Variable de ligne Copie
Dim Com_API As String 'Variable du Commantaire API de la _
variable pointée
Dim Com_APS As String 'Variable du Commantaire APS de la _
variable pointée
li_API = 2
li_APS = 2
li_Mnemo_API = 2
li_Mnemo_APS = 2
'Copie ou Recopie APS vers API
'Création des lignes de base
Sheets("Copie").Cells(1, 1) = "APS"
Sheets("Copie").Cells(1, 2) = "VERS"
Sheets("Copie").Cells(1, 3) = "API"
Sheets("Copie").Cells(1, 4) = "Commentaire"
'Implémentation de la recopie ...
While (Sheets("Info_db_API").Cells(li_API, 5) <> Empty)
r_split = Split(Sheets("Info_db_API").Cells(li_API, 10), " ", -1, _
vbTextCompare)
r_Ubound = UBound(r_split)
r_Lbound = LBound(r_split)
If (r_split((r_Ubound - 2)) = "DE" And r_split((r_Ubound - 1)) = "APS" _
And r_split((r_Ubound)) = "STATION") Then
Com_API = ??
End If
While (Sheets("Info_db_APS").Cells(li_APS, 5) <> Empty)
r_split = Split(Sheets("Info_db_APS").Cells(li_APS, 10), " ", -1, _
vbTextCompare)
r_Ubound = UBound(r_split)
r_Lbound = LBound(r_split)
If (r_split((r_Ubound - 2)) = "VERS" And r_split((r_Ubound - 1)) = _
"API" And r_split((r_Ubound) = "STATION")) Then
Com_APS = ??
End If
li_APS = li_APS + 1
Wend
If Com_API = Com_APS Then
Sheets("Copie").Cells(li_Copie, 1) = _
Sheets("Info_db_APS").Cells(li_APS, 9)
Sheets("Copie").Cells(li_Copie, 3) = _
Sheets("Info_db_APS").Cells(li_API, 9)
Sheets("Copie").Cells(li_Copie, 4) = Com_API
li_Copie = li_Copie + 1
End If
li_API = li_API + 1
Wend
End Sub, ----
(Coloration syntaxique automatique par Kenji)
MerZi ... Zi ... Zi ... PtitCat
P.S:DSL pour l'orthographe