Bonjour,
Non cela ne change rien si l'on change l'affichage dans excel. Je pense que c'est au niveau de la macro.
Je vous envoie ci-dessous la macro où le format des chiffres est indiqué (colonnes L et M) qui ne sont pas bonnes car le rendu est bien un chiffre décimal mais systématiquement avec une virgule et deux zéros, alors que je ne veux pas des deux zéros, je veux les deux chiffres d'origine, sans aucun arrondi au niveau de l'entier.
Merci par avance,
On Error GoTo MesErreurs
Workbooks.OpenText Filename:="C:\WS_SAGE\ecriture.txt", Origin:=xlWindows, _
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False _
, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 4), _
Array(3, 1), Array(4, 2), Array(5, 2), Array(6, 1), Array(7, 1), Array(8, 1), Array(9, 4), _
Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15, 1), Array( _
16, 1), Array(17, 1), Array(18, 1), Array(19, 1), Array(20, 1), Array(21, 1), Array(22, 1)) _
, TrailingMinusNumbers:=True
ActiveWindow.Zoom = 10
Columns("B:B").Select
Selection.NumberFormat = "ddmmyy"
Columns("I:I").Select
Selection.NumberFormat = "ddmmyy"
Columns("I:I").Select
Selection.NumberFormat = "ddmmyy"
Columns("I:I").Select
Selection.NumberFormat = "ddmmyy"
' On compte le nombre de lignes du tableau et on le met dans la variable NBRLIGN
With ActiveSheet
.Activate
.Range("D" & .Range("D65536").End(xlUp)(1).Row).Select
End With
nbrlign = (ActiveSheet.Range("D65536").End(xlUp)(1).Row)
Columns("G:G").Select
Selection.NumberFormat = "@"
For ilign = 1 To nbrlign
Range("C" & ilign).Activate
un = ActiveCell.Value
deux = Left(ActiveCell.Value, 3)
trois = Len(ActiveCell.Value)
Select Case deux
Case "401"
Gtiers = Mid(un, 4, trois - 3)
ActiveCell.Value = "401000"
Range("G" & ilign).Activate
ActiveCell.Value = Gtiers
Case "411"
Gtiers = Mid(un, 4, trois - 3)
ActiveCell.Value = "411000"
Range("G" & ilign).Activate
ActiveCell.Value = Gtiers
End Select
Next ilign
For ilign = 1 To nbrlign
Range("K" & ilign).Activate
ActiveCell.Value = Val(ActiveCell.Value)
ActiveCell.NumberFormat = "0.000000"
Next ilign
For ilign = 1 To nbrlign
Range("L" & ilign).Activate
ActiveCell.Value = Val(ActiveCell.Value)
ActiveCell.NumberFormat = "0.00"
Next ilign
For ilign = 1 To nbrlign
Range("M" & ilign).Activate
ActiveCell.Value = Val(ActiveCell.Value)
ActiveCell.NumberFormat = "0.00"
Next ilign
For ilign = 1 To nbrlign
Range("N" & ilign).Activate
ActiveCell.Value = "G"
Next ilign
Columns("A:A").Select
Selection.NumberFormat = "@"
For ilign = 1 To nbrlign
Range("A" & ilign).Activate
Select Case Len(ActiveCell.Value)
Case 1
trs = ActiveCell.Value
ActiveCell.Value = "0" & trs
End Select
Next ilign
For ilign = 1 To nbrlign
Range("J" & ilign).Activate
Monnaie = ActiveCell.Value
Select Case Monnaie
Case "$"
ActiveCell.Value = "USD"
End Select
Next ilign
Range("N1").Select
Selection.EntireColumn.Insert
For ilign = 1 To nbrlign
Range("J" & ilign).Activate
Select Case ActiveCell.Value
Case Is <> "EUR"
Range("K" & ilign).Activate
ValDevise = ActiveCell.Value
Range("L" & ilign).Activate
Select Case ActiveCell.Value
Case Is > 0
COLL = ActiveCell.Value
ActiveCell.Value = COLL / ValDevise
Range("N" & ilign).Activate
ActiveCell.Value = COLL
Case Else
Range("M" & ilign).Activate
COLM = ActiveCell.Value
ActiveCell.Value = COLM / ValDevise
Range("N" & ilign).Activate
ActiveCell.Value = COLM
End Select
End Select
Next ilign
Beep
ActiveWindow.Zoom = 100
Range("A1").Select
Msg = MsgBox("Travail terminé", vbInformation + vbOKOnly, "Macro Ecritures Comptables")
Exit Sub
MesErreurs:
Msg = MsgBox("Erreur d'exécution " & Err.Number & vbCrLf & vbCrLf & Err.Description, vbCritical + vbOKOnly, "Macro Ecritures Comptables")
End Sub