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
| 'ouverture du fichier .csv
vFichierCSV = "E:\DONNEES\COMMUN\Rel_appels\Table_Index.csv"
'vFichierCSV = "E:\DONNEES\COMMUN\Relève appels\Table_Index.csv"
Open vFichierCSV For Input As #1
Do While Not EOF(1)
Line Input #1, Texte
Index = Empty
On Error Resume Next
Var = Split(Texte, ";")(6)
'Var = "409002700118"
Windows("MBAPEL.xls").Activate
cells(1, 1).Select
cells.Find(what:=(Var), After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlWhole, SearchOrder _
:=xlByRows, SearchDirection:=xlNext, MatchCase:=False).Activate
reference = ActiveCell
If reference <> "" And reference <> "SUB" And Split(Texte, ";")(0) = centre Then
Index = Split(Texte, ";")(7) & " " & Split(Texte, ";")(8) & " " & Split(Texte, ";")(9) & " " & Split(Texte, ";")(10) & " " & Split(Texte, ";")(11) & " " & Split(Texte, ";")(12)
Windows("MBAPEL.xls").Activate
If cells(1, 13) = "Observations" Then
ActiveCell.Offset(0, 11).Value = Index
Else: ActiveCell.Offset(0, 16).Value = Index
End If
End If
Loop
Close #1 |
Partager