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 40 41 42 43 44 45 46 47 48 49 50 51 52
| Sub FormatBalanceMaquette()
Application.ScreenUpdating = False
Dim Societe As Range
Dim LastRow As Long
Dim i As Integer
Dim ShBAL As Worksheet
'Durée Macro
Dim MACRODEBUT As Date
MACRODEBUT = Now
'Mise au format des cellules Référence, Compte et montant de la balance
Set ShBAL = Worksheets("Bal_new")
ShBAL.Range("AH4:AN1048576").Clear
ShBAL.Range("AH3:AN3").Select
ShBAL.Range("AH3:AN3").Copy
LastRow = ShBAL.Cells(ShBAL.Rows.Count, "A").End(xlUp).Row
i = LastRow
ShBAL.Range(Cells(i, "AH"), Cells(i, "AH").End(xlUp)).Offset(1, 0).Select
ShBAL.Range(Cells(i, "AH"), Cells(i, "AH").End(xlUp)).Offset(1, 0).PasteSpecial xlPasteFormulas
ShBAL.Range("AH4:AN1048576").Select
ShBAL.Range("AH4:AN1048576").Copy
ShBAL.Range("AH4:AN1048576").PasteSpecial xlPasteValues
ShBAL.Range(Cells(i, "AL"), Cells(i, "AL").End(xlUp)).Offset(1, 0).Select
ShBAL.Range(Cells(i, "AL"), Cells(i, "AL").End(xlUp)).Offset(1, 0).NumberFormat = "@"
ShBAL.Range(Cells(i, "AL"), Cells(i, "AL").End(xlUp)).Offset(1, 0) = Format(ShBAL.Range(Cells(i, "AL"), Cells(i, "AL").End(xlUp)).Offset(1, 0), "000000000000000000")
Range("AR4") = Format(Now - MACRODEBUT, "hh:mm:ss")
MsgBox "Mise au format balance - Traitement terminé"
Application.ScreenUpdating = True
End Sub |
Partager