1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| Sub TriCol()
Dim MaPlage As Range, SousPlage As Range
Dim TabPlanning As Variant
ReDim TabPlanning(1 To 204, 1 To 10)
TabPlanning(1, 1) = "FirstCell"
TabPlanning(4, 2) = 1: TabPlanning(4, 3) = 10: TabPlanning(4, 4) = 100
TabPlanning(5, 2) = 2: TabPlanning(5, 3) = 5: TabPlanning(5, 4) = 200
TabPlanning(204, 10) = "LastCell"
Set MaPlage = Worksheets("Temp").Range("A1").Resize(UBound(TabPlanning, 1), UBound(TabPlanning, 2))
Set SousPlage = MaPlage.Parent.Range(MaPlage.Cells(4, 3), MaPlage.Cells(204, 4))
MaPlage.Value = TabPlanning
SousPlage.Select
SousPlage.Sort Range("C4")
TabPlanning = MaPlage.Value
End Sub |
Partager