Bonjour à tous,
merci de m'aider
J'ai un code (Extraction des données à partir d'un fichier text par ''position'' ). qui marche bien, sauf la colonne du Montant.
Exemple :
20000000PYD00000000052193001601230313040123040123
20000005KWI00000000721935001601233132040123040123
20000000ZSE00000000005000001601230014040123040123
les montants doivent afficher comme suite : 521.93 / 7219.35 / 50.00
Dim myFile As String, text As String
Dim rw As Long, cl As Long
myFile = Application.GetOpenFilename()
rw = 5
cl = 1
Open myFile For Input As #1
While Not EOF(1)
Line Input #1, text
If Left(text, 2) = "20" Then
Cells(rw, cl + 1) = Mid(text, 47, 3)
Cells(rw, cl + 2) = Mid(text, 9, 3)
Cells(rw, cl + 3) = Format(Mid(text, 20, 6), "0000.00") 'Format de nombre ####.## La virgule afficher après 4 numéro
Cells(rw, cl + 4) = Format(Mid(text, 28, 6), "00\/00\/00") 'Date Format Type DD/MM/YY
rw = rw + 1
cl = cl + 0
End If
Wend
Close #1
End Sub