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
|
Sub Lissage()
Dim X()
Dim I As Long
Dim Fichier As String
Fichier = ActiveWorkbook.Sheets("bathy").Cells(7, 6)
Open Fichier For Input As #1
Do While Not EOF(1)
I = I + 1
'redimensionne le tableau (3 colonnes et x lignes)
ReDim Preserve X(1 To 3, 1 To I)
'récup directe dans le tableau
Input #1, X(1, I), X(2, I), X(3, I)
Loop
Close #1
Open Fichier For Output As #1
For I = 1 To UBound(X, 2)
'remplace la virgule par le point
Print #1, Replace(X(1, I), ",", "."), _
Replace(X(2, I), ",", "."), _
Replace(-X(3, I), ",", ".")
Next I
Close #1
End Sub |
Partager