Bonjour à tous,
Je suis actuellement entrain d'essayer de générer un code pour mettre en forme des données que j'importe d'un logiciel sur SAP.
Je rencontre depuis vendredi après-midi un problème à la fois curieux et bizarre, il remplace bien les points par rien avec mon code :
	
	
	
	
	
		
Mais, quand je veux faire la somme de ma colonne B, j'obtiens un résultat de "232" alors que le vrai résultat est en M€ 😛 (voir screenshot ci-dessous)
		
		
	
	

Je vous joint également le code en entier, quand tous fonctionnera, je ferais l'épuration de celui-ci.
	
	
	
	
	
		
Merci d'avance pour votre aide.
Bonne fête 😀 .
	
		
			
		
		
	
				
			Je suis actuellement entrain d'essayer de générer un code pour mettre en forme des données que j'importe d'un logiciel sur SAP.
Je rencontre depuis vendredi après-midi un problème à la fois curieux et bizarre, il remplace bien les points par rien avec mon code :
		Code:
	
	
	    Columns("B:B").Select
    Selection.Replace What:=".", Replacement:="", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
	Mais, quand je veux faire la somme de ma colonne B, j'obtiens un résultat de "232" alors que le vrai résultat est en M€ 😛 (voir screenshot ci-dessous)

Je vous joint également le code en entier, quand tous fonctionnera, je ferais l'épuration de celui-ci.
		Code:
	
	
	Sub essai1()
Dim i As Integer
Dim X As Long
Dim R As Range
    Rows("1:36").Select
    Range("A36").Activate
    Selection.Delete Shift:=xlUp
    Range("A:A,C:E,G:U").Select
    Selection.Delete Shift:=xlToLeft
    ActiveWindow.ScrollColumn = 5
    ActiveWindow.ScrollColumn = 4
    ActiveWindow.ScrollColumn = 3
    ActiveWindow.ScrollColumn = 2
    ActiveWindow.ScrollColumn = 1
    Rows("2:2").Select
    Selection.Delete Shift:=xlUp
    Columns("A:A").EntireColumn.AutoFit
    Columns("D:D").EntireColumn.AutoFit
    Range("A1:B999").Select
    For n = Range("A" & Rows.Count).End(xlUp).Row To 5 Step -1
  If Range("A" & n) = "* Sur-/Sous-absorption" Then
    Rows(n).Delete
  End If
  Next
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlInsideVertical)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlInsideHorizontal)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    ActiveWindow.SmallScroll Down:=-12
    Range("A1:B1").Select
    Selection.Font.Bold = True
    With Selection.Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .Color = 10092492
        .TintAndShade = 0
        .PatternTintAndShade = 0
    End With
    With Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    Range("A1").Select
  For Each R In Range("A1", [A6000].End(xlUp))
    R = Replace(LTrim(R), Chr(160), "")
  Next
For X = 2 To Range("B65536").End(xlUp).Row
        Range("B" & X) = Replace(Range("B" & X), Chr(160), "")
        Range("B" & X) = Replace(Range("B" & X), Chr(32), "")
Next X
    Columns("B:B").Select
    Selection.Replace What:=".", Replacement:="", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
End Sub
	Merci d'avance pour votre aide.
Bonne fête 😀 .
Pièces jointes
			
				Dernière édition: