Excel : Affichage de toutes les possibilités.
vivabarca_max
Messages postés
4
Statut
Membre
-
Mike-31 Messages postés 19572 Date d'inscription Statut Contributeur Dernière intervention -
Mike-31 Messages postés 19572 Date d'inscription Statut Contributeur Dernière intervention -
Bonjour,
Je me demande s'il est possible, avec Excel, d'insérer 10 possibilités (par exemple 1, 2, 3, 4, 5, 6, 7, 8, 9 et 10) et de demander à Excel d'afficher toutes les possibilités lorsqu'on en choisit 4 parmi les 10 et où l'ordre n'a pas d'importance.
Il y a donc 210 possibilités, par exemple :
1 2 3 4
2 6 8 9
3 5 6 7
etc.
Est-ce possible ?
Merci !
Je me demande s'il est possible, avec Excel, d'insérer 10 possibilités (par exemple 1, 2, 3, 4, 5, 6, 7, 8, 9 et 10) et de demander à Excel d'afficher toutes les possibilités lorsqu'on en choisit 4 parmi les 10 et où l'ordre n'a pas d'importance.
Il y a donc 210 possibilités, par exemple :
1 2 3 4
2 6 8 9
3 5 6 7
etc.
Est-ce possible ?
Merci !
A voir également:
- Excel : Affichage de toutes les possibilités.
- Liste déroulante excel - Guide
- Word et excel gratuit - Guide
- Si ou excel - Guide
- Déplacer colonne excel - Guide
- Excel trier par ordre croissant chiffre - Guide
2 réponses
Salut,
Peut être avec ce code VBA écrit par Soenda sur excel-downloads que j'ai adapté
Sub Extraction()
Dim x1%, x2%, x3%, x4%, x5%, t() As Integer
Dim L As Long
ReDim t(WorksheetFunction.Combin(10, 5) - 1, 4)
For x1 = 1 To 10
For x2 = x1 + 1 To 10
For x3 = x2 + 1 To 10
For x4 = x3 + 1 To 10
t(L, 0) = x1: t(L, 1) = x2: t(L, 2) = x3: t(L, 3) = x4 ': t(L, 4) = n5
L = L + 1
Next x4, x3, x2, x1
Feuil1.[A1:D1].Resize(L) = t
End Sub
Peut être avec ce code VBA écrit par Soenda sur excel-downloads que j'ai adapté
Sub Extraction()
Dim x1%, x2%, x3%, x4%, x5%, t() As Integer
Dim L As Long
ReDim t(WorksheetFunction.Combin(10, 5) - 1, 4)
For x1 = 1 To 10
For x2 = x1 + 1 To 10
For x3 = x2 + 1 To 10
For x4 = x3 + 1 To 10
t(L, 0) = x1: t(L, 1) = x2: t(L, 2) = x3: t(L, 3) = x4 ': t(L, 4) = n5
L = L + 1
Next x4, x3, x2, x1
Feuil1.[A1:D1].Resize(L) = t
End Sub