Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

urbanito1

XLDnaute Occasionnel
bonsoir au forum,

je cherche un moyen de ne pas avoir de doublons dans un petit tri aléatoire
je joins mon fichier sur base de ce que je déjà trouvé
en vous remerciant
urbanito1
 

Pièces jointes

Re : Tri aleatoire

Re à tous,

C'est pas fini 🙄
Un peu lent au démarrage :
VB:
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
klin89
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
5
Affichages
258
Réponses
2
Affichages
165
Réponses
3
Affichages
202
Retour