1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
| Dim ligne_debut As Integer: Dim colonne_debut As Integer
Dim ligne_fin As Integer: Dim colonne_fin As Integer
Dim ligne_enCours As Integer: Dim colonne_enCours As Integer
Dim j As Integer
Private Sub Exporter_Click()
j = 1
ligne_debut = 2: colonne_debut = 2
ligne_enCours = ligne_debut: colonne_enCours = colonne_debut
Cells.Clear
For I = 0 To liste_fichiers.ListCount - 1
lecture (liste_fichiers.List(I))
j = j + 1
ligne_enCours = ligne_debut
Next I
End Sub
Private Sub Fermer_Click()
Close
End Sub
Private Sub Importer_Click()
Dim fichier_choisi As Variant
fichier_choisi = Application.GetOpenFilename("Atf Files (*.atf), *.ATF", , "Sélectionner le fichier ATF", , False)
liste_fichiers.AddItem (fichier_choisi)
End Sub
Sub lecture(fichier As String)
Dim depart As Integer, position As Integer
Dim texte As String, tampon As String
Open fichier For Input As #1
Do While Not EOF(1)
Line Input #1, texte
depart = 1: position = 1
Do While (position <> 0)
position = InStr(depart, texte, ";", 1)
If position = 0 Then
tampon = Mid(texte, depart)
Sheets("Import").Cells(ligne_enCours, j).Value = tampon
Else: tampon = Mid(texte, depart, position - depart)
Exit Do
End If
Sheets("Import").Cells(ligne_enCours, j).Value = tampon
depart = position + 1
colonne_enCours = colonne_enCours + 1
Loop
colonne_enCours = colonne_debut
ligne_enCours = ligne_enCours + 1
Loop
Close #1
End Sub
Private Sub ecriture(fichier As String)
End Sub
Private Sub traitement()
End Sub |
Partager