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
| Sub MacroTest()
Dim ID As String
Dim Name As String
Dim Montant As Double
Dim tableau()
ReDim tableau(24, 2)
'i = 0 : i = j-1
'On désactive le rafraichissement de la session
Application.ScreenUpdating = False
'Il vaut mieux préciser toute les informations, Fichier-Feuille-Range
With ThisWorkbook.Worksheets("TEST")
For j = 1 To 25
ID = .Cells(j, "A") 'plus facile à relir (à mon avis)
Name = .Cells(j, "B")
Montant = .Cells(j, "C")
tableau(j - 1, 0) = Format(ID, "General")
tableau(j - 1, 1) = Format(Name, "@")
tableau(j - 1, 2) = Format(Val(Montant), "0,00") 'ici essaie la virgule au lieu du point
'i = i + 1
Next j
End With
With ThisWorkbook.Worksheets(Resultat)
.Select
.Range(Cells(3, 1), Cells(28, 3)).Value = tableau
End With
End Sub |
Partager