[SIZE=2]Sub Test()
[COLOR=green]'myDearFriend! Aout 2006[/COLOR]
[COLOR=green]'(pour Excel 2000 minimum)[/COLOR]
[COLOR=navy]Dim [/COLOR]Fichier[COLOR=navy] As Object
Dim [/COLOR]TabTemp[COLOR=navy] As Variant
Dim [/COLOR]Chemin[COLOR=navy] As String[/COLOR], T[COLOR=navy] As String
Dim [/COLOR]Cumul[COLOR=navy] As Double
Dim [/COLOR]L[COLOR=navy] As Long
Dim [/COLOR]NbCol[COLOR=navy] As Integer[/COLOR], C[COLOR=navy] As Byte[/COLOR]
[COLOR=green]'Colonne cible[/COLOR]
C = 3
Chemin = ThisWorkbook.Path & "\" & "test.txt"
[COLOR=green]'Mémorise les données[/COLOR]
[COLOR=navy]Set[/COLOR] Fichier = Create[COLOR=navy]Object[/COLOR]("Scripting.FileSystem[COLOR=navy]Object[/COLOR]").[COLOR=navy]Open[/COLOR]TextFile(Chemin, 1)
T = Fichier.[COLOR=navy]Read[/COLOR]All
[COLOR=green]'Compte le nombre de colonnes[/COLOR]
NbCol = [COLOR=navy]UBound[/COLOR](Split(Left(T, InStr(1, T, Chr(13))), ";")) + 1
Fichier.[COLOR=navy]Close[/COLOR]
[COLOR=green]'Cumul des données de la 3ème colonne[/COLOR]
T = Replace(T, Chr(13), ";")
T = Replace(T, Chr(10), "")
TabTemp = Split(T, ";")
[COLOR=navy]For [/COLOR]L = C - 1[COLOR=navy] To UBound[/COLOR](TabTemp) [COLOR=navy]Step[/COLOR] NbCol
Cumul = Cumul + Val(TabTemp(L))
[COLOR=navy]Next[/COLOR] L
MsgBox "Total de la colonne " & C & " = " & Cumul
[COLOR=navy]End[/COLOR] Sub[/SIZE]