Transformer un fichier texte par excel avecVB
Résolu/Fermé
DiabloAndSab
Messages postés
80
Date d'inscription
mardi 9 octobre 2007
Statut
Membre
Dernière intervention
19 février 2009
-
9 oct. 2007 à 11:26
DiabloAndSab Messages postés 80 Date d'inscription mardi 9 octobre 2007 Statut Membre Dernière intervention 19 février 2009 - 16 oct. 2007 à 16:58
DiabloAndSab Messages postés 80 Date d'inscription mardi 9 octobre 2007 Statut Membre Dernière intervention 19 février 2009 - 16 oct. 2007 à 16:58
A voir également:
- Transformer un fichier texte par excel avecVB
- Fichier rar - Guide
- Liste déroulante excel - Guide
- Formule excel - Guide
- Dans le texte, un seul mot a réellement été écrit en lettres capitales (majuscules). quel est ce mot ? ✓ - Forum Word
- Formule excel si contient texte alors texte ✓ - Forum Excel
4 réponses
Je te répondrais pour la partie théorique car c'est à toi de créer les macros nécessaire au traitement du fichier texte:
1/ Ton fichier texte est composé de section (chaque lot de volume); tu dois faire passer ta macro en boucle sur chaque section. Il faut donc pouvoir identifier les sections par des éléments disctinctifs de début et de fin.
Ici ce serait le texte "Fichiers Dern mise jour Archiv‚ * AccŠs Cr‚‚/copi‚ " de début (en prenant la ligne d'avant)
Et "octets" pour la fin
2/ Chaque ligne de section devra être traité pour savoir si elles sont utile ou non
L'avant premiére ligne doit être conservé pour servir de référence et construire le fichier final
Les deux lignes suivantes ne sont pas utile
Traitement de chaque ligne d'information jusqu'à ce que la ligne soit vide
Alors tu passe à la section suivante.
1er difficulté, dans quel format importé le fichier texte dans Excel, je pense qu'en format brut cela devrait être correcte, tout doit être dans une seul colonne.
2éme difficulté, rechercher la fin du fichier importé dans une boucle pour compter le nombre de ligne total. Connaissant le nombre de ligne total, tu peux réaliser la boucle de traitement des sections. (tester la valeur de chaque ligne si elles contient le texte rechercher; mettre la valeur du numéro de ligne dans une variable)
Si tu passe ces deux difficultés (qui ne sont pas insurmontable), tu auras un beau fichier formaté qui sera presque automatisé. Pour réellement l'automatisé, tu doit penser à chaque exception que peut contenir ton fichier... mais là on dépasse la question posé.
Voilà, bon courage
Fidel
1/ Ton fichier texte est composé de section (chaque lot de volume); tu dois faire passer ta macro en boucle sur chaque section. Il faut donc pouvoir identifier les sections par des éléments disctinctifs de début et de fin.
Ici ce serait le texte "Fichiers Dern mise jour Archiv‚ * AccŠs Cr‚‚/copi‚ " de début (en prenant la ligne d'avant)
Et "octets" pour la fin
2/ Chaque ligne de section devra être traité pour savoir si elles sont utile ou non
L'avant premiére ligne doit être conservé pour servir de référence et construire le fichier final
Les deux lignes suivantes ne sont pas utile
Traitement de chaque ligne d'information jusqu'à ce que la ligne soit vide
Alors tu passe à la section suivante.
1er difficulté, dans quel format importé le fichier texte dans Excel, je pense qu'en format brut cela devrait être correcte, tout doit être dans une seul colonne.
2éme difficulté, rechercher la fin du fichier importé dans une boucle pour compter le nombre de ligne total. Connaissant le nombre de ligne total, tu peux réaliser la boucle de traitement des sections. (tester la valeur de chaque ligne si elles contient le texte rechercher; mettre la valeur du numéro de ligne dans une variable)
Si tu passe ces deux difficultés (qui ne sont pas insurmontable), tu auras un beau fichier formaté qui sera presque automatisé. Pour réellement l'automatisé, tu doit penser à chaque exception que peut contenir ton fichier... mais là on dépasse la question posé.
Voilà, bon courage
Fidel
DiabloAndSab
Messages postés
80
Date d'inscription
mardi 9 octobre 2007
Statut
Membre
Dernière intervention
19 février 2009
2
9 oct. 2007 à 14:23
9 oct. 2007 à 14:23
Oui je suis d'accord mais faut que tout soit automatisé donc j'ai pensé à VB sous excel mon code n'est pas bon mais je le met quand même:
Option Explicit
Private Sub CommandButton1_Click()
Dim i As Variant
Dim cell As String
Dim cell2 As String
Dim trouveVide As Boolean
Dim loca As String
Dim cellR As String
Dim loca2 As String
Dim j As Integer
j = 0
i = 0
cell = "l"
loca2 = "A1"
Do
While (cell = "NDIR" Or i = 65536)
i = i + 1
loca = "A" & i
cell = Workbooks("transformer.xls").Worksheets("Feuil2").Range(loca).Value
If cell = "NDIR" Then
Wend
If cell = "CMSA79" Then
' supprimer *.*
cell2 = Strip(cell, "*.*")
Else
cellR = cell2 & cell
Workbooks("transformer.xls").Worksheets("Feuil1").Range(loca2).Value = cellR
j = j + 1
loca2 = "A" & j
End If
If cell = "NDIR" Then
trouveVide = True
End If
Loop Until trouveVide = True
End Sub
Merci de ta réponse qui a été trés rapide!!!
Option Explicit
Private Sub CommandButton1_Click()
Dim i As Variant
Dim cell As String
Dim cell2 As String
Dim trouveVide As Boolean
Dim loca As String
Dim cellR As String
Dim loca2 As String
Dim j As Integer
j = 0
i = 0
cell = "l"
loca2 = "A1"
Do
While (cell = "NDIR" Or i = 65536)
i = i + 1
loca = "A" & i
cell = Workbooks("transformer.xls").Worksheets("Feuil2").Range(loca).Value
If cell = "NDIR" Then
Wend
If cell = "CMSA79" Then
' supprimer *.*
cell2 = Strip(cell, "*.*")
Else
cellR = cell2 & cell
Workbooks("transformer.xls").Worksheets("Feuil1").Range(loca2).Value = cellR
j = j + 1
loca2 = "A" & j
End If
If cell = "NDIR" Then
trouveVide = True
End If
Loop Until trouveVide = True
End Sub
Merci de ta réponse qui a été trés rapide!!!
DiabloAndSab
Messages postés
80
Date d'inscription
mardi 9 octobre 2007
Statut
Membre
Dernière intervention
19 février 2009
2
9 oct. 2007 à 16:59
9 oct. 2007 à 16:59
avec ce code j'arrive presque au résultat attendu sauf des lignes que je n'arrive pas à interférer:
Private Sub CommandButton1_Click()
Dim i As Variant
Dim cell As String
Dim cell2 As String
Dim trouveVide As Boolean
Dim loca As String
Dim cellR As String
Dim loca2 As String
Dim j As Integer
Dim ch As String
Dim cellN As String
j = 0
i = 0
cell = "m"
loca2 = "A1"
a:
While (cell <> "CMSA79" Or i = 4000 Or trouveVide = True)
i = i + 1
loca = "A" & i
ch = Workbooks("transformer.xls").Worksheets("Feuil2").Range(loca).Value
cell = Left(ch, 6)
If cell = "CMSA79" Then
' supprimer *.*
cell2 = Strip(ch, "*", ".", ":")
cell2 = cell2 & "/"
End If
If i = 65534 Then
trouveVide = True
End If
Wend
Do
i = i + 1
loca = "A" & i
ch = Workbooks("transformer.xls").Worksheets("Feuil2").Range(loca).Value
cell = Left(ch, 6)
If cell = "CMSA79" Then
cellR = ""
' supprimer *.*
cell2 = Strip(ch, "*", ".")
cell2 = cell2 & "/"
i = i + 2
loca = "A" & i
ch = Workbooks("transformer.xls").Worksheets("Feuil2").Range(loca).Value
End If
cellN = Left(ch, 6)
If ch <> " " Or cellN <> "Fichie" Or cellN <> "------" Then
cellR = cell2 & ch
Workbooks("transformer.xls").Worksheets("Feuil1").Range(loca2).Value = cellR
j = j + 1
loca2 = "A" & j
End If
If cell = "" Then GoTo a
Loop Until trouveVide = True
End Sub
le resultat est:
CMSA79SEN01/VOL02/----------------- --------------- --------------- - -------- ---------------
CMSA79SEN01/VOL02/GROUPS~1.NA2 25/11/05 16:50 3/03/06 12:29 A 8/03/06 25/11/05 16:50
CMSA79SEN01/VOL02/ICON_~1 1/03/06 9:01 0/00/00 0:00 A 9/08/07 1/03/06 9:01
CMSA79SEN01/VOL02/INFOAR~1.HTM 31/01/07 11:38 0/00/00 0:00 A 31/01/07 31/01/07 11:38
CMSA79SEN01/VOL02/INFOCH~1.HTM 31/01/07 11:38 0/00/00 0:00 A 31/01/07 31/01/07 11:38
CMSA79SEN01/VOL02/LIPREFS.JS 7/08/06 16:47 0/00/00 0:00 A 7/08/06 7/08/06 16:47
CMSA79SEN01/VOL02/MAINM7~1.HTM 31/01/07 11:38 0/00/00 0:00 A 31/01/07 31/01/07 11:38
CMSA79SEN01/VOL02/RACCOU~1.LNK 19/03/07 14:41 0/00/00 0:00 A 19/03/07 19/03/07 14:41
CMSA79SEN01/VOL02/TRUSTEE.TXT 18/09/07 9:10 0/00/00 0:00 A 18/09/07 18/09/07 9:00
CMSA79SEN01/VOL02/VOL$LOG.ERR 3/03/06 19:02 3/03/06 12:29 A 3/03/06 14/02/06 19:30
CMSA79SEN01/VOL02/VOLDATA.TDF 18/09/07 11:00 0/00/00 0:00 A 18/09/07 1/03/06 10:00
CMSA79SEN01/VOL02/VOLUME~1.HTM 28/04/06 16:27 0/00/00 0:00 A 28/04/06 28/04/06 16:27
CMSA79SEN01/VOL02/VOLUME~1.XML 28/04/06 16:27 0/00/00 0:00 A 28/04/06 28/04/06 16:25
CMSA79SEN01/VOL02/VOLUME~2.XML 28/04/06 16:27 0/00/00 0:00 A 28/04/06 28/04/06 16:27
CMSA79SEN01/VOL02/
CMSA79SEN01/VOL02AP\COM\/Fichiers Dern mise jour Archiv‚ * AccŠs Cr‚‚/copi‚
CMSA79SEN01/VOL02AP\COM\/----------------- --------------- --------------- - -------- ---------------
CMSA79SEN01/VOL02AP\COM\/GRILLE.DAT 14/09/01 16:21 1/03/06 8:46 - 28/02/06 17/09/01 10:08
CMSA79SEN01/VOL02AP\COM\/GRILLE.IDX 14/09/01 16:22 1/03/06 8:46 - 28/02/06 17/09/01 10:08
CMSA79SEN01/VOL02AP\COM\/REFTRANS.TXT 3/05/00 10:30 1/03/06 8:46 - 28/02/06 19/06/01 14:56
CMSA79SEN01/VOL02AP\COM\/TABLE.DAT 14/09/01 16:22 1/03/06 8:46 - 28/02/06 17/09/01 10:09
CMSA79SEN01/VOL02AP\COM\/WS_FTP.LOG 21/06/01 9:05 1/03/06 8:46 - 28/02/06 21/06/01 8:59
CMSA79SEN01/VOL02AP\COM\/
CMSA79SEN01/VOL02AP\COM\TPL\/Fichiers Dern mise jour Archiv‚ * AccŠs Cr‚‚/copi‚
CMSA79SEN01/VOL02AP\COM\TPL\/----------------- --------------- --------------- - -------- ---------------
CMSA79SEN01/VOL02AP\COM\TPL\/FZ9Z79 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:46
CMSA79SEN01/VOL02AP\COM\TPL\/FZ9Z79.IDX 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:46
CMSA79SEN01/VOL02AP\COM\TPL\/RFZ9Z79 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:46
CMSA79SEN01/VOL02AP\COM\TPL\/RFZ9Z79.IDX 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:46
CMSA79SEN01/VOL02AP\COM\TPL\/
CMSA79SEN01/VOL02AP\PM79\/Fichiers Dern mise jour Archiv‚ * AccŠs Cr‚‚/copi‚
CMSA79SEN01/VOL02AP\PM79\/----------------- --------------- --------------- - -------- ---------------
CMSA79SEN01/VOL02AP\PM79\/GRILLE.DAT 14/09/01 16:21 1/03/06 8:46 - 28/02/06 17/09/01 10:14
CMSA79SEN01/VOL02AP\PM79\/GRILLE.IDX 14/09/01 16:22 1/03/06 8:46 - 28/02/06 17/09/01 10:14
CMSA79SEN01/VOL02AP\PM79\/TABLE.DAT 14/09/01 16:22 1/03/06 8:46 - 28/02/06 17/09/01 10:14
CMSA79SEN01/VOL02AP\PM79\/WS_FTP.LOG 21/06/01 10:37 1/03/06 8:46 - 23/01/06 21/06/01 10:43
CMSA79SEN01/VOL02AP\PM79\/
CMSA79SEN01/VOL02AP\PM79\TPL\/Fichiers Dern mise jour Archiv‚ * AccŠs Cr‚‚/copi‚
CMSA79SEN01/VOL02AP\PM79\TPL\/----------------- --------------- --------------- - -------- ---------------
CMSA79SEN01/VOL02AP\PM79\TPL\/FZ9Z79 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:43
CMSA79SEN01/VOL02AP\PM79\TPL\/FZ9Z79.IDX 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:43
CMSA79SEN01/VOL02AP\PM79\TPL\/RFZ9Z79 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:43
CMSA79SEN01/VOL02AP\PM79\TPL\/RFZ9Z79.IDX 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:43
CMSA79SEN01/VOL02AP\PM79\TPL\/
CMSA79SEN01/VOL02CHECKUP\INVINIT\/Fichiers Dern mise jour Archiv‚ * AccŠs Cr‚‚/copi‚
CMSA79SEN01/VOL02CHECKUP\INVINIT\/----------------- --------------- --------------- - -------- ---------------
CMSA79SEN01/VOL02CHECKUP\INVINIT\/CHECKUP.CFG 28/03/07 9:33 0/00/00 0:00 A 28/03/07 28/03/07 9:33
CMSA79SEN01/VOL02CHECKUP\INVINIT\/CHECKUP.LIC 16/10/03 14:53 0/00/00 0:00 A 27/03/07 27/03/07 10:56
CMSA79SEN01/VOL02CHECKUP\INVINIT\/CHECKUP.OLD 27/03/07 10:56 0/00/00 0:00 - 27/03/07 27/03/07 10:56
CMSA79SEN01/VOL02CHECKUP\INVINIT\/GETADM16.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56
CMSA79SEN01/VOL02CHECKUP\INVINIT\/GETADM32.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56
CMSA79SEN01/VOL02CHECKUP\INVINIT\/GETCAR16.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56
CMSA79SEN01/VOL02CHECKUP\INVINIT\/GETCAR32.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56
CMSA79SEN01/VOL02CHECKUP\INVINIT\/GETSFT16.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56
CMSA79SEN01/VOL02CHECKUP\INVINIT\/GETSFT32.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56
voilà je continue à cherhcer en attendant votre aide!
Private Sub CommandButton1_Click()
Dim i As Variant
Dim cell As String
Dim cell2 As String
Dim trouveVide As Boolean
Dim loca As String
Dim cellR As String
Dim loca2 As String
Dim j As Integer
Dim ch As String
Dim cellN As String
j = 0
i = 0
cell = "m"
loca2 = "A1"
a:
While (cell <> "CMSA79" Or i = 4000 Or trouveVide = True)
i = i + 1
loca = "A" & i
ch = Workbooks("transformer.xls").Worksheets("Feuil2").Range(loca).Value
cell = Left(ch, 6)
If cell = "CMSA79" Then
' supprimer *.*
cell2 = Strip(ch, "*", ".", ":")
cell2 = cell2 & "/"
End If
If i = 65534 Then
trouveVide = True
End If
Wend
Do
i = i + 1
loca = "A" & i
ch = Workbooks("transformer.xls").Worksheets("Feuil2").Range(loca).Value
cell = Left(ch, 6)
If cell = "CMSA79" Then
cellR = ""
' supprimer *.*
cell2 = Strip(ch, "*", ".")
cell2 = cell2 & "/"
i = i + 2
loca = "A" & i
ch = Workbooks("transformer.xls").Worksheets("Feuil2").Range(loca).Value
End If
cellN = Left(ch, 6)
If ch <> " " Or cellN <> "Fichie" Or cellN <> "------" Then
cellR = cell2 & ch
Workbooks("transformer.xls").Worksheets("Feuil1").Range(loca2).Value = cellR
j = j + 1
loca2 = "A" & j
End If
If cell = "" Then GoTo a
Loop Until trouveVide = True
End Sub
le resultat est:
CMSA79SEN01/VOL02/----------------- --------------- --------------- - -------- ---------------
CMSA79SEN01/VOL02/GROUPS~1.NA2 25/11/05 16:50 3/03/06 12:29 A 8/03/06 25/11/05 16:50
CMSA79SEN01/VOL02/ICON_~1 1/03/06 9:01 0/00/00 0:00 A 9/08/07 1/03/06 9:01
CMSA79SEN01/VOL02/INFOAR~1.HTM 31/01/07 11:38 0/00/00 0:00 A 31/01/07 31/01/07 11:38
CMSA79SEN01/VOL02/INFOCH~1.HTM 31/01/07 11:38 0/00/00 0:00 A 31/01/07 31/01/07 11:38
CMSA79SEN01/VOL02/LIPREFS.JS 7/08/06 16:47 0/00/00 0:00 A 7/08/06 7/08/06 16:47
CMSA79SEN01/VOL02/MAINM7~1.HTM 31/01/07 11:38 0/00/00 0:00 A 31/01/07 31/01/07 11:38
CMSA79SEN01/VOL02/RACCOU~1.LNK 19/03/07 14:41 0/00/00 0:00 A 19/03/07 19/03/07 14:41
CMSA79SEN01/VOL02/TRUSTEE.TXT 18/09/07 9:10 0/00/00 0:00 A 18/09/07 18/09/07 9:00
CMSA79SEN01/VOL02/VOL$LOG.ERR 3/03/06 19:02 3/03/06 12:29 A 3/03/06 14/02/06 19:30
CMSA79SEN01/VOL02/VOLDATA.TDF 18/09/07 11:00 0/00/00 0:00 A 18/09/07 1/03/06 10:00
CMSA79SEN01/VOL02/VOLUME~1.HTM 28/04/06 16:27 0/00/00 0:00 A 28/04/06 28/04/06 16:27
CMSA79SEN01/VOL02/VOLUME~1.XML 28/04/06 16:27 0/00/00 0:00 A 28/04/06 28/04/06 16:25
CMSA79SEN01/VOL02/VOLUME~2.XML 28/04/06 16:27 0/00/00 0:00 A 28/04/06 28/04/06 16:27
CMSA79SEN01/VOL02/
CMSA79SEN01/VOL02AP\COM\/Fichiers Dern mise jour Archiv‚ * AccŠs Cr‚‚/copi‚
CMSA79SEN01/VOL02AP\COM\/----------------- --------------- --------------- - -------- ---------------
CMSA79SEN01/VOL02AP\COM\/GRILLE.DAT 14/09/01 16:21 1/03/06 8:46 - 28/02/06 17/09/01 10:08
CMSA79SEN01/VOL02AP\COM\/GRILLE.IDX 14/09/01 16:22 1/03/06 8:46 - 28/02/06 17/09/01 10:08
CMSA79SEN01/VOL02AP\COM\/REFTRANS.TXT 3/05/00 10:30 1/03/06 8:46 - 28/02/06 19/06/01 14:56
CMSA79SEN01/VOL02AP\COM\/TABLE.DAT 14/09/01 16:22 1/03/06 8:46 - 28/02/06 17/09/01 10:09
CMSA79SEN01/VOL02AP\COM\/WS_FTP.LOG 21/06/01 9:05 1/03/06 8:46 - 28/02/06 21/06/01 8:59
CMSA79SEN01/VOL02AP\COM\/
CMSA79SEN01/VOL02AP\COM\TPL\/Fichiers Dern mise jour Archiv‚ * AccŠs Cr‚‚/copi‚
CMSA79SEN01/VOL02AP\COM\TPL\/----------------- --------------- --------------- - -------- ---------------
CMSA79SEN01/VOL02AP\COM\TPL\/FZ9Z79 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:46
CMSA79SEN01/VOL02AP\COM\TPL\/FZ9Z79.IDX 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:46
CMSA79SEN01/VOL02AP\COM\TPL\/RFZ9Z79 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:46
CMSA79SEN01/VOL02AP\COM\TPL\/RFZ9Z79.IDX 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:46
CMSA79SEN01/VOL02AP\COM\TPL\/
CMSA79SEN01/VOL02AP\PM79\/Fichiers Dern mise jour Archiv‚ * AccŠs Cr‚‚/copi‚
CMSA79SEN01/VOL02AP\PM79\/----------------- --------------- --------------- - -------- ---------------
CMSA79SEN01/VOL02AP\PM79\/GRILLE.DAT 14/09/01 16:21 1/03/06 8:46 - 28/02/06 17/09/01 10:14
CMSA79SEN01/VOL02AP\PM79\/GRILLE.IDX 14/09/01 16:22 1/03/06 8:46 - 28/02/06 17/09/01 10:14
CMSA79SEN01/VOL02AP\PM79\/TABLE.DAT 14/09/01 16:22 1/03/06 8:46 - 28/02/06 17/09/01 10:14
CMSA79SEN01/VOL02AP\PM79\/WS_FTP.LOG 21/06/01 10:37 1/03/06 8:46 - 23/01/06 21/06/01 10:43
CMSA79SEN01/VOL02AP\PM79\/
CMSA79SEN01/VOL02AP\PM79\TPL\/Fichiers Dern mise jour Archiv‚ * AccŠs Cr‚‚/copi‚
CMSA79SEN01/VOL02AP\PM79\TPL\/----------------- --------------- --------------- - -------- ---------------
CMSA79SEN01/VOL02AP\PM79\TPL\/FZ9Z79 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:43
CMSA79SEN01/VOL02AP\PM79\TPL\/FZ9Z79.IDX 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:43
CMSA79SEN01/VOL02AP\PM79\TPL\/RFZ9Z79 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:43
CMSA79SEN01/VOL02AP\PM79\TPL\/RFZ9Z79.IDX 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:43
CMSA79SEN01/VOL02AP\PM79\TPL\/
CMSA79SEN01/VOL02CHECKUP\INVINIT\/Fichiers Dern mise jour Archiv‚ * AccŠs Cr‚‚/copi‚
CMSA79SEN01/VOL02CHECKUP\INVINIT\/----------------- --------------- --------------- - -------- ---------------
CMSA79SEN01/VOL02CHECKUP\INVINIT\/CHECKUP.CFG 28/03/07 9:33 0/00/00 0:00 A 28/03/07 28/03/07 9:33
CMSA79SEN01/VOL02CHECKUP\INVINIT\/CHECKUP.LIC 16/10/03 14:53 0/00/00 0:00 A 27/03/07 27/03/07 10:56
CMSA79SEN01/VOL02CHECKUP\INVINIT\/CHECKUP.OLD 27/03/07 10:56 0/00/00 0:00 - 27/03/07 27/03/07 10:56
CMSA79SEN01/VOL02CHECKUP\INVINIT\/GETADM16.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56
CMSA79SEN01/VOL02CHECKUP\INVINIT\/GETADM32.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56
CMSA79SEN01/VOL02CHECKUP\INVINIT\/GETCAR16.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56
CMSA79SEN01/VOL02CHECKUP\INVINIT\/GETCAR32.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56
CMSA79SEN01/VOL02CHECKUP\INVINIT\/GETSFT16.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56
CMSA79SEN01/VOL02CHECKUP\INVINIT\/GETSFT32.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56
voilà je continue à cherhcer en attendant votre aide!
DiabloAndSab
Messages postés
80
Date d'inscription
mardi 9 octobre 2007
Statut
Membre
Dernière intervention
19 février 2009
2
16 oct. 2007 à 16:58
16 oct. 2007 à 16:58
Ca y est j'ai réussi grâce au mode debuggage et exécution pas détaillé,
en fete le code a la fin ressemble à çà avec le petit selon en plus pour plus de style:
et le résultat devait etre çà:
enfin seulement les premiere lignes car y en a réellement des dizaines de millers:
Enfin tout doit etre sur une ligne!!!
Merci à Fidel qui fut le seul à m'avoir aidé!!!!!
merci beaucoup Fidel
en fete le code a la fin ressemble à çà avec le petit selon en plus pour plus de style:
Option Explicit Private Sub CommandButton1_Click() Dim k As Integer Dim cell As String Dim cell2 As String Dim trouveVide As Boolean Dim loca As String Dim cellR As String Dim loca2 As String Dim j As Integer Dim ch As String Dim cellN As String Dim cellcase As String j = 0 k = 0 cell = "m" loca2 = "A1" a: While (cell <> "CMSA79" Or k >= 4000 Or trouveVide = True) If k > 4000 Then GoTo b k = k + 1 loca = "A" & k ch = Workbooks("transformer.xls").Worksheets("Feuil2").Range(loca).Value cell = Left(ch, 6) If cell = "CMSA79" Then ' supprimer *.* cell2 = Strip(ch, "*", ".", ":") cellcase = Left(cell2, 17) Select Case cellcase Case "CMSA79SEN01/VOL02" cellcase = "H:\" & Mid(cell2, 18) Case "CMSA79SEN01/VOL01" cellcase = "G:\" & Mid(cell2, 18) Case "CMSA79SEN01/VOL03" cellcase = "I:\" & Mid(cell2, 18) End Select cell2 = cellcase End If If k = 65534 Then trouveVide = True End If Wend Do k = k + 1 loca = "A" & k ch = Workbooks("transformer.xls").Worksheets("Feuil2").Range(loca).Value cell = Left(ch, 6) If cell = "CMSA79" Then cellR = "" ' supprimer *.* cell2 = Strip(ch, "*", ".") cell2 = cell2 & "/" k = k + 2 loca = "A" & k ch = Workbooks("transformer.xls").Worksheets("Feuil2").Range(loca).Value End If cellN = Left(ch, 6) If ch = " " Or cellN = "Fichie" Or cellN = "------" Then Else cellR = cell2 & ch j = j + 1 loca2 = "A" & j Workbooks("transformer.xls").Worksheets("transformer").Range(loca2).Value = cellR End If If cell = "" Then GoTo a Loop Until trouveVide = True Or k > 4000 b: End Sub
et le résultat devait etre çà:
enfin seulement les premiere lignes car y en a réellement des dizaines de millers:
H:\GROUPS~1.NA2 25/11/05 16:50 3/03/06 12:29 A 8/03/06 25/11/05 16:50 H:\ICON_~1 1/03/06 9:01 0/00/00 0:00 A 9/08/07 1/03/06 9:01 H:\INFOAR~1.HTM 31/01/07 11:38 0/00/00 0:00 A 31/01/07 31/01/07 11:38 H:\INFOCH~1.HTM 31/01/07 11:38 0/00/00 0:00 A 31/01/07 31/01/07 11:38 H:\LIPREFS.JS 7/08/06 16:47 0/00/00 0:00 A 7/08/06 7/08/06 16:47 H:\MAINM7~1.HTM 31/01/07 11:38 0/00/00 0:00 A 31/01/07 31/01/07 11:38 H:\RACCOU~1.LNK 19/03/07 14:41 0/00/00 0:00 A 19/03/07 19/03/07 14:41 H:\TRUSTEE.TXT 18/09/07 9:10 0/00/00 0:00 A 18/09/07 18/09/07 9:00 H:\VOL$LOG.ERR 3/03/06 19:02 3/03/06 12:29 A 3/03/06 14/02/06 19:30 H:\VOLDATA.TDF 18/09/07 11:00 0/00/00 0:00 A 18/09/07 1/03/06 10:00 H:\VOLUME~1.HTM 28/04/06 16:27 0/00/00 0:00 A 28/04/06 28/04/06 16:27 H:\VOLUME~1.XML 28/04/06 16:27 0/00/00 0:00 A 28/04/06 28/04/06 16:25 H:\VOLUME~2.XML 28/04/06 16:27 0/00/00 0:00 A 28/04/06 28/04/06 16:27 H:\ H:\AP\COM\GRILLE.DAT 14/09/01 16:21 1/03/06 8:46 - 28/02/06 17/09/01 10:08 H:\AP\COM\GRILLE.IDX 14/09/01 16:22 1/03/06 8:46 - 28/02/06 17/09/01 10:08 H:\AP\COM\REFTRANS.TXT 3/05/00 10:30 1/03/06 8:46 - 28/02/06 19/06/01 14:56 H:\AP\COM\TABLE.DAT 14/09/01 16:22 1/03/06 8:46 - 28/02/06 17/09/01 10:09 H:\AP\COM\WS_FTP.LOG 21/06/01 9:05 1/03/06 8:46 - 28/02/06 21/06/01 8:59 H:\AP\COM\ H:\AP\COM\TPL\FZ9Z79 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:46 H:\AP\COM\TPL\FZ9Z79.IDX 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:46 H:\AP\COM\TPL\RFZ9Z79 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:46 H:\AP\COM\TPL\RFZ9Z79.IDX 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:46 H:\AP\COM\TPL\ H:\AP\PM79\GRILLE.DAT 14/09/01 16:21 1/03/06 8:46 - 28/02/06 17/09/01 10:14 H:\AP\PM79\GRILLE.IDX 14/09/01 16:22 1/03/06 8:46 - 28/02/06 17/09/01 10:14 H:\AP\PM79\TABLE.DAT 14/09/01 16:22 1/03/06 8:46 - 28/02/06 17/09/01 10:14 H:\AP\PM79\WS_FTP.LOG 21/06/01 10:37 1/03/06 8:46 - 23/01/06 21/06/01 10:43 H:\AP\PM79\ H:\AP\PM79\TPL\FZ9Z79 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:43 H:\AP\PM79\TPL\FZ9Z79.IDX 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:43 H:\AP\PM79\TPL\RFZ9Z79 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:43 H:\AP\PM79\TPL\RFZ9Z79.IDX 21/06/01 10:29 1/03/06 8:46 - 23/01/06 21/06/01 10:43 H:\AP\PM79\TPL\ H:\CHECKUP\INVINIT\CHECKUP.CFG 28/03/07 9:33 0/00/00 0:00 A 28/03/07 28/03/07 9:33 H:\CHECKUP\INVINIT\CHECKUP.LIC 16/10/03 14:53 0/00/00 0:00 A 27/03/07 27/03/07 10:56 H:\CHECKUP\INVINIT\CHECKUP.OLD 27/03/07 10:56 0/00/00 0:00 - 27/03/07 27/03/07 10:56 H:\CHECKUP\INVINIT\GETADM16.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56 H:\CHECKUP\INVINIT\GETADM32.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56 H:\CHECKUP\INVINIT\GETCAR16.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56 H:\CHECKUP\INVINIT\GETCAR32.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56 H:\CHECKUP\INVINIT\GETSFT16.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56 H:\CHECKUP\INVINIT\GETSFT32.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56 H:\CHECKUP\INVINIT\LDCHK3.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56 H:\CHECKUP\INVINIT\PAKRES16.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56 H:\CHECKUP\INVINIT\PAKRES32.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56 H:\CHECKUP\INVINIT\SCNCHK16.EXE 6/09/02 4:20 0/00/00 0:00 A 27/03/07 27/03/07 10:56 H:\CHECKUP\INVINIT\SCNCHK32.EXE 6/09/02 4:20 0/00/00 0:00 A 18/09/07 27/03/07 10:56 H:\CHECKUP\INVINIT\SOFTWARE.DTA 28/03/07 9:33 0/00/00 0:00 A 28/03/07 28/03/07 9:33 H:\CHECKUP\INVINIT\SOFTWARE.OLD 10/10/05 18:10 0/00/00 0:00 - 27/03/07 27/03/07 10:56 H:\CHECKUP\INVINIT\TABLES.DTA 21/08/07 14:01 0/00/00 0:00 A 21/08/07 21/08/07 14:01 H:\CHECKUP\INVINIT\TABLES.OLD 16/04/99 11:50 0/00/00 0:00 - 27/03/07 27/03/07 10:56 H:\CHECKUP\INVINIT\ H:\CHECKUP\INVINIT\RESULT\M75KST~1.CKP 29/08/07 16:23 0/00/00 0:00 A 29/08/07 29/08/07 16:23 H:\CHECKUP\INVINIT\RESULT\M78PNJ~1.CKP 14/09/07 14:57 0/00/00 0:00 A 14/09/07 14/09/07 14:57 H:\CHECKUP\INVINIT\RESULT\M79002~1.CKP 3/07/07 9:29 0/00/00 0:00 A 3/07/07 3/07/07 9:29 H:\CHECKUP\INVINIT\RESULT\M79002~2.CKP 4/07/07 15:07 0/00/00 0:00 A 4/07/07 4/07/07 15:07 H:\CHECKUP\INVINIT\RESULT\M79002~3.CKP 27/07/07 16:24 0/00/00 0:00 A 27/07/07 27/07/07 16:24 H:\CHECKUP\INVINIT\RESULT\M79002~4.CKP 17/08/07 15:47 0/00/00 0:00 A 17/08/07 17/08/07 15:47 H:\CHECKUP\INVINIT\RESULT\M7ANHA~1.CKP 12/09/07 14:37 0/00/00 0:00 A 12/09/07 12/09/07 14:37 H:\CHECKUP\INVINIT\RESULT\M7R71C~1.CKP 21/08/07 14:03 0/00/00 0:00 A 21/08/07 21/08/07 14:03 H:\CHECKUP\INVINIT\RESULT\M7U1JG~1.CKP 23/08/07 16:17 0/00/00 0:00 A 23/08/07 23/08/07 16:17 H:\CHECKUP\INVINIT\RESULT\WS_FTP.LOG 28/06/07 14:37 0/00/00 0:00 A 28/06/07 3/04/07 14:46 H:\CHECKUP\INVINIT\RESULT\ H:\CHECKUP\INVPERM\CHECKUP.CFG 27/03/07 10:53 0/00/00 0:00 A 28/03/07 28/03/07 9:33 H:\CHECKUP\INVPERM\CHECKUP.LIC 16/10/03 14:53 0/00/00 0:00 A 27/03/07 27/03/07 10:57 H:\CHECKUP\INVPERM\CHECKUP.OLD 27/03/07 10:53 0/00/00 0:00 - 27/03/07 27/03/07 10:57
Enfin tout doit etre sur une ligne!!!
Merci à Fidel qui fut le seul à m'avoir aidé!!!!!
merci beaucoup Fidel