Sub Essai()
Dim e, i As Long, j As Long, n As Long
Application.ScreenUpdating = False
Cells(1).CurrentRegion.Clear
For i = 1 To 5
With CreateObject("System.Collections.SortedList")
Randomize
For Each e In Array("Vincent", "Claire", "Sandra", "Paul", "Max", "Anne")
.Item(Rnd) = e
Next
For j = 0 To .Count - 1
n = n + 1
If n < 7 Then
Cells(n, i).Offset(1).Value = .GetByIndex(j)
End If
Next
n = 0
End With
Next
Cells(1).Resize(, 5) = [{"Lundi","Mardi","Mercredi","Jeudi","Vendredi"}]
With Cells(1).CurrentRegion
With .Rows(1)
.BorderAround ColorIndex:=1, Weight:=xlThin
.Interior.ColorIndex = 44
End With
.BorderAround ColorIndex:=1, Weight:=xlThin
.Borders(xlInsideVertical).Weight = xlThin
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Font.Name = "calibri"
.Font.Size = 11
End With
Application.ScreenUpdating = True
End Sub