1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Sub testSMF()
Range("AE7:AU13").ClearContents
ecartparpoule = 0
nbdossards = Range("A65536").End(xlUp).Row - 5
If Int((nbdossards) / 6) <> ((nbdossards) / 6) Then
nombredepoules = Int((nbdossards) / 6) + 1
Else
nombredepoules = (nbdossards) / 6
End If
Range("AF2") = nombredepoules
ligne = 7
col = 31
pas = 3
For n = 6 To Range("A65536").End(xlUp).Row
Cells(ligne, col) = Range("A" & n)
col = col + pas
If col = 31 + 3 * nombredepoules Or col = 28 Then
ligne = ligne + 1
col = col - pas
pas = -pas
End If
Next n
End Sub |