'---------------- Suppression des onglets --------------
Sheets("Base_de_Donnees").Select
MsgBox "1"
For n = 0 To ListBox1.ListCount - 1
MsgBox "2"
If ListBox1.Selected(n) Then
For Each sh In Sheets
If sh.Name = ListBox1.List(n) Or Left(sh.Name, Len(ListBox1.List(n)) + 1) = ListBox1.List(n) & "_" Then sh.Delete
Next
End If
Next
Exit Sub
'---------------- Suppression BDD ----------------------
'
'
'Cells.Select
' Range("A1").Activate
' Selection.AutoFilter
' ''Je voudrais lui dire de filtrer jusque la dernière cellule pleine ....
' For n = 0 To ListBox1.ListCount - 1
' ActiveSheet.Range("$A$1:$A$65530").AutoFilter Field:=1, Criteria1:=ComboBox1.Value
' ActiveSheet.Range("$A$1:$A$65530").AutoFilter Field:=2, Criteria1:=ListBox1.List(n)
' Next
'
'With Worksheets("Base_de_donnees").Range("a1:a65530") 'prend en compte l'onglet
'
' pa = "" 'réinitialise la variable pa
' Set r = .Find(ComboBox1.Value, , xlValues, xlWhole) 'définit la recherche
' If Not r Is Nothing Then 'condition : si il existe au moins une occurrence trouvée
'
' pa = r.Address 'définit la variable pa
' Do 'exécute
'
' r.Select
' Selection.EntireRow.Delete
'
' Set r = .FindNext 'reféfinit la recherche r (Prochaine occurrence)
' Loop While Not r Is Nothing 'And c.Address <> firstAddress
' Selection.AutoFilter
' 'ComboBox1_Change
' Dim f
' Set f = Sheets("Base_de_donnees")
' Set mondico = CreateObject("Scripting.Dictionary")
' For Each c In Range(f.[A2], f.[a65000].End(xlUp))
' mondico(c.Value) = c.Value
' Next c
' temp = mondico.items
' 'Call Tri3(temp, LBound(temp), UBound(temp))
' Me.ComboBox1.List = temp
' End If
' End With
End Sub