bonjour,
j'ai changé le code comme ceci, cela fonctionne mais je ne suis pas un expert donc si une personne peut me confirmer que cela est bon merci à vous:
Private Sub Worksheet_selectionChange(ByVal Target As Range)
'----------------------------------------------liste deroulante pour chercher le nom----------------------------------------------------------------------------------
'rechereche de nom
Dim tTab, tREC(), x
Dim LigneAct As String
Dim Valcell As String
If Selection.Count > 1 Then Exit Sub
Me.cbREC.Visible = False
LigneAct = ActiveCell.Row 'trouve la ligne de la cell selectionée
Valcell = Cells(LigneAct, 4).Value 'donne la valeur de la cell selectionée
If Valcell <> "" Then Exit Sub 'si le cellule est diff de nul exit sub sinon la liste est visible
If Not Intersect(Target, Columns(4)) Is Nothing Then
Me.cbREC.Clear
Me.cbREC.Top = Target.Top
Me.cbREC.Left = Target.Left
Me.cbREC.Height = ActiveCell.RowHeight + 4
Me.cbREC.Width = ActiveCell.ColumnWidth * 5.5
With Worksheets("Personnel")
tTab = .Range("A2:B" & .Range("B" & Rows.Count).End(xlUp).Row).Value
' tTab = .Range(Range("A" & Rows.Count).End(xlUp).Row).Value
End With
For x = 1 To UBound(tTab, 1)
'Me.cbREC.AddItem tTab(x, 1) & " " & tTab(x, 2)
Me.cbREC.AddItem tTab(x, 1)
Next
Me.cbREC.Visible = True
Me.cbREC.Activate
End If
encore bonne fête à tous
cdt