1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Public Sub MethodeTableau()
Dim Plage As Range, compteur As Long, OldVals As Variant, NewVals As Variant, lgTime As Long
Application.ScreenUpdating = False
With ThisWorkbook.Worksheets(1)
Set Plage = .Range(.Cells(1, 1), .Cells(.Rows.Count, 1).End(xlUp))
End With
OldVals = Plage.Value
Plage.Delete xlShiftUp
ReDim NewVals(1 To UBound(OldVals) \ 3, 1 To 1)
For compteur = 1 To UBound(OldVals) Step 3
NewVals((compteur \ 3) + 1, 1) = OldVals(compteur, 1)
Next compteur
Set Plage = ThisWorkbook.Worksheets(1).Cells(1, 1).Resize(UBound(NewVals))
Plage.Value = NewVals
End Sub |
Partager