Private Sub CommandButton1_Click() Range("A1").Value = "attention" Range("A2").Value = "avant de taper une valeur" Range("A3").Value = "assurez-vous d'utiliser la proposition" Range("A4").Value = "affichée ci-joint" Range("A5").Value = "sans quoi ce" Range("A6").Value = "serait pénible a" Range("A7").Value = "sa" Range("A8").Value = "saisie" ComboBox1.ListFillRange = "Feuil1!a1: a8" ComboBox1.AutoWordSelect = True End Sub
Private Sub ComboBox1_Change() Dim i As Integer ListBox1.Visible = False ListBox1.Clear For i = 1 To 8 If InStr(1, Range("A" & i).Text, ComboBox1.Text) > 0 Then ListBox1.AddItem Range("A" & i).Text Next If ListBox1.ListCount > 0 Then ListBox1.Visible = True ListBox1.Height = ListBox1.ListCount * 14 End If End Sub Private Sub CommandButton1_Click() ListBox1.Visible = False ListBox1.Width = ComboBox1.Width ListBox1.Left = ComboBox1.Left ListBox1.Top = ComboBox1.Top + ComboBox1.Height Range("A1").Value = "saviez-vous" Range("A2").Value = "sans le savoir" Range("A3").Value = "que" Range("A4").Value = "quelconque" Range("A5").Value = "qui" Range("A6").Value = "questionne" Range("A7").Value = "sa" Range("A8").Value = "saisie" ComboBox1.AutoWordSelect = False End Sub Private Sub ListBox1_Click() ComboBox1.Text = ListBox1.Text ListBox1.Visible = False End Sub