Si vous pouvez m'expliquer le code
Option Explicit
Dim ln&, iL&, col&
Private Sub ListBox1_Click()
ActiveCell = ListBox1
Unload Me
End Sub
Private Sub UserForm_initialize()
ListBox1.List = Sheets("Effectif").Range("A2:A" & Sheets("Effectif").Range("A" & Rows.Count).End(xlUp).Row).Value
col = ActiveCell.Column
For ln = 18 To 68
For iL = 0 To ListBox1.ListCount - 1
If Cells(ln, col) = ListBox1.List(iL) Then
ListBox1.RemoveItem iL
Exit For
End If
Next iL
Next ln
End Sub
--------------------------------------------------------------------------------------------------------------------------------------------------
Option Explicit
Dim lignes As Variant, plage As Range
Dim i&, j&
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Set plage = Range("H18")
lignes = Array(18, 20, 22, 23, 25, 27, 30, 32, 34, 36, 38, 41, 43, 45, 47, 49, 51, 53, _
55, 57, 60, 62, 64, 66, 68)
For i = 0 To UBound(lignes)
For j = 8 To 33
Set plage = Union(plage, Cells(lignes(i), j))
Next j
Next i
If Not Intersect(Target, plage) Is Nothing Then
UserForm1.Show
End If
Cancel = True
End Sub
Merci bcp!
@gmb svp j'ai ajouté une spécialité à côté de mon effectif et je voudrais à chaque cellule de chaque ligne qu'excel m'affiche seulement les personnes spécialistes