Famille de feuilles de calcul Microsoft avec des outils pour l’analyse, le graphique et la communication des données.
Sur si peu de lignes, on ne va pas gagner grand chose. Exécute la macro ci-dessous et dis-moi le nombre qui s'affiche en fin de macro.
Quelle est la dernière colonne du tableau ?
Quelles sont les formules en E13 et 013 ?
Sub insererLig3() 'palettes complètes et pas complètes utilisées dans le fichier
Dim lig As Long, Deb
Deb = Timer
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
For lig = Cells(Rows.Count, 2).End(xlUp).Row To 13 Step -1
If Cells(lig, "B") <> Cells(lig + 1, "B") And Cells(lig, "S") = 2 Then
Rows(lig + 1).Resize(Cells(lig, "Q") - 1).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Cells(lig + 1, 2).Resize(Cells(lig, "Q") - 1, 1) = Cells(lig, "B")
Cells(lig + 1, 5).Resize(Cells(lig, "Q") - 1, 1) = Cells(lig, "E")
Cells(lig + 1, 7).Resize(Cells(lig, "Q") - 1, 1) = Cells(lig, "O")
Cells(lig + 1, 11).Resize(Cells(lig, "Q") - 1, 1) = Cells(lig, "K")
Cells(lig + 1, 12).Resize(Cells(lig, "Q") - 1, 1) = Cells(lig, "L")
Cells(lig, "S").Offset(0, -12).Value = Cells(lig, "S").Offset(0, -4)
End If
If Cells(lig, "B") <> Cells(lig + 1, "B") And Cells(lig, "S") = 1 Then
Rows(lig + 1).Resize(Cells(lig, "Q")).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Cells(lig + 1, 2).Resize(Cells(lig, "Q"), 1) = Cells(lig, "B")
Cells(lig + 1, 5).Resize(Cells(lig, "Q"), 1) = Cells(lig, "E")
Cells(lig + 1, 7).Resize(Cells(lig, "Q"), 1) = Cells(lig, "O")
Cells(lig + 1, 11).Resize(Cells(lig, "Q"), 1) = Cells(lig, "K")
Cells(lig + 1, 12).Resize(Cells(lig, "Q"), 1) = Cells(lig, "L")
Cells(lig, "S").Offset(Cells(lig, "Q"), -12).Value = Cells(lig, "S").Offset(0, -1)
Cells(lig, "S").Offset(0, -12).Value = Cells(lig, "S").Offset(0, -4)
End If
Next lig
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
MsgBox Timer - Deb
End Sub
Daniel