Re-bonjour,
J'ai réussi à activer un code dans mon fichier mais il ne fonctionne pas correctement.
Quand je tape des lettres rien ne se passe ou ça m'envoie directement à la ligne en dessous alors que je n'ai même pas tapé de lettre lui appartenant.
Ci-dessous le code utilisé avec mes modifications de ligne, fichier et classeur :
Dim a()
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect([A8:A8], Target) Is Nothing And Target.Count = 1 Then
a = Sheets("Liste Enseigne").Range("Enseigne").Value
Me.ComboBox1.List = a
Me.ComboBox1.Height = Target.Height + 3
Me.ComboBox1.Width = Target.Width
Me.ComboBox1.Top = Target.Top
Me.ComboBox1.Left = Target.Left
Me.ComboBox1 = Target
Me.ComboBox1.Visible = True
Me.ComboBox1.Activate
'If Target <> "" Then SendKeys "{esc}"
'Me.ComboBox1.DropDown ' ouverture automatique au clic dans la cellule (optionel)
Else
Me.ComboBox1.Visible = False
End If
End Sub
Private Sub ComboBox1_Change()
If Me.ComboBox1 <> "" Then
Set d1 = CreateObject("Scripting.Dictionary")
tmp = UCase(Me.ComboBox1) & "*"
For Each c In a
If UCase(c) Like tmp Then d1(c) = ""
Next c
Me.ComboBox1.List = d1.keys
Me.ComboBox1.DropDown
End If
ActiveCell.Value = Me.ComboBox1
End Sub
Private Sub ComboBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Me.ComboBox1.List = a
Me.ComboBox1.Activate
Me.ComboBox1.DropDown
End Sub
Private Sub ComboBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 13 Then ActiveCell.Offset(1).Select
End Sub
Hier j'ai demandé de l'aide pour un code qui est aussi sur cette cellule et donc également le code donné par Robert (
https://www.excel-downloads.com/threads/macro-selectionner-resultat-recherchev.20010761/)
Peut-il y avoir un court-circuit ? Merci de votre aide.
Cordialement,