Donc voici le code de ma combobox
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Private Sub ComboBox1_Click()
Dim index As Long
On Error GoTo fin
index = Sheets("BDD").Columns("A").Find(ComboBox1.Text, LookAt:=xlWhole).Row
CleanForm1Data
UploadData (index)
Unload Me
Exit Sub
fin: MsgBox "Attention un filtre est resté mis sur la feuille BDD"
End Sub
Private Sub ComboBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii.Value = "27" Then Unload Me
End Sub
Private Sub UserForm_Initialize()
For i = 2 To Sheets("BDD").Range("A" & Rows.Count).End(xlUp).Row + 1
ComboBox1.AddItem (Sheets("BDD").Range("A" & i).Text)
Next i
End Sub |
J'ai essayer de rajouter comme ligne
Combobox1.TopIndex = -300
Voici le fichier en question
Partager