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
| Private Sub RegroupementDonnees_Click()
Dim DebRayon As Range
Dim DebDroite As Range
Dim DebRecap As Range
Dim Position As Long
Dim PosDroite As Long
Set DebRayon = Range("DebutRayon")
Set DebDroite = Range("DebutDroite")
Set DebRecap = Range("DebutRecap")
Application.ScreenUpdating = False
Range(DebRecap, DebRecap.End(xlDown).Offset(0, 5)).ClearContents
Position = 0
While DebRayon.Offset(Position).Value <> ""
DebRecap.Offset(Position).Value = DebRayon.Offset(Position).Value
DebRecap.Offset(Position, 1).Value = DebRayon.Offset(Position, 1).Value
DebRecap.Offset(Position, 2).Value = DebRayon.Offset(Position, 2).Value
DebRecap.Offset(Position, 3).Value = DebRayon.Offset(Position, 3).Value
DebRecap.Offset(Position, 4).Value = DebRayon.Offset(Position, 4).Value
DebRecap.Offset(Position, 5).Value = DebRayon.Offset(Position, 5).Value
Position = Position + 1
Wend
PosDroite = 0
While DebDroite.Offset(PosDroite).Value <> ""
DebRecap.Offset(Position).Value = DebDroite.Offset(PosDroite).Value
DebRecap.Offset(Position, 1).Value = DebDroite.Offset(PosDroite, 1).Value
DebRecap.Offset(Position, 2).Value = DebDroite.Offset(PosDroite, 2).Value
DebRecap.Offset(Position, 3).Value = DebDroite.Offset(PosDroite, 3).Value
DebRecap.Offset(Position, 4).Value = DebDroite.Offset(PosDroite, 4).Value
DebRecap.Offset(Position, 5).Value = DebDroite.Offset(PosDroite, 5).Value
Position = Position + 1
PosDroite = PosDroite + 1
Wend
Application.ScreenUpdating = True
End Sub |
Partager