Possibilité de choix multiples dans menu déroulant.

carsat21

XLDnaute Nouveau
Bonjour à toutes et tous,
Je vous joins le fichier ci-joint pour lequel je souhaiterai créer pour dans la cellule A2 de la 1ere feuille une possibilité de choix multiple (sélectionner plusieurs choix dans la liste et les afficher dans la même cellule A2.
Je vous remercie pour votre aide.

Je suis novice et m'y connait donc que très peu sur excel.
 

Pièces jointes

  • FICHIER DE SUIVI 2.xlsx
    10.6 KB · Affichages: 8

riton00

XLDnaute Impliqué
Bonjour,

Si j'ai bien compris ta demande, voici un exemple que l'on trouve sur le site de Boisgnontier
Attention pour fonctionner il faut activer les macros

Slts
 

Pièces jointes

  • FICHIER DE SUIVI 2.xlsm
    27 KB · Affichages: 22

job75

XLDnaute Barbatruc
Bonjour carsat21, bienvenue sur XLD, salut riton00,

Voyez le fichier joint et ces macros dans le code de la 1ère feuille (clic droit sur l'onglet et Visualiser le code) :
VB:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Column > 1 Or ActiveCell.Row = 1 Then ListBox1.Visible = False: Exit Sub
Dim i&
For i = 0 To ListBox1.ListCount - 1
    ListBox1.Selected(i) = False
Next
ListBox1.Top = ActiveCell.Top
ListBox1.Left = ActiveCell(1, 2).Left
ListBox1.Visible = True
End Sub

Private Sub ListBox1_Change()
Dim i&, a(), n&
For i = 0 To ListBox1.ListCount - 1
    If ListBox1.Selected(i) Then
        ReDim Preserve a(n)
        a(n) = ListBox1.List(i, 0)
        n = n + 1
    End If
Next
ActiveCell = Join(a, "-")
End Sub
A+
 

Pièces jointes

  • FICHIER DE SUIVI(1).xlsm
    28.9 KB · Affichages: 10

job75

XLDnaute Barbatruc
Pour initialiser la ListBox ce fichier (2) et cette macro sont mieux :
VB:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Column > 1 Or ActiveCell.Row = 1 Then ListBox1.Visible = False: Exit Sub
Dim x$, i&
x = "-" & ActiveCell & "-"
For i = 0 To ListBox1.ListCount - 1
    ListBox1.Selected(i) = InStr(x, "-" & ListBox1.List(i, 0) & "-")
Next
ListBox1.Top = ActiveCell.Top
ListBox1.Left = ActiveCell(1, 2).Left
ListBox1.Visible = True
End Sub
 

Pièces jointes

  • FICHIER DE SUIVI(2).xlsm
    29.3 KB · Affichages: 18

Statistiques des forums

Discussions
311 733
Messages
2 082 019
Membres
101 872
dernier inscrit
Colin T