Private Sub CommandButton1_Click()
Dim Nbligne As Integer
Dim Ligne As Integer
Dim Code As String
Dim cCode As Range
If ComboBox1.Value <> "" Then
If Sheets(ComboBox1.Value).Range("A18").Value = "" Then
Exit Sub
End If
With ListBox1
For Ligne = 0 To .ListCount - 1
If .Selected(Ligne) = True Then
Code = Sheets(ComboBox1.Value).Range("B" & Ligne + 18).Text
Sheets(ComboBox1.Value).Range("A" & Ligne + 18 & ":G" & Ligne + 18).Delete Shift:=xlUp
End If
Next Ligne
End With
Nbligne = Sheets(ComboBox1.Value).Range("A65536").End(xlUp).Row + 1
If Sheets(ComboBox1.Value).Range("A18") <> "" Then
IniListbox1
End If
End If
If Code <> "" Then
'Si on a supprimé une ligne
With Sheets("Base")
'Trouver le code correspondant dans la feuille Base
Set cCode = .Range("B:B").Find( _
What:=Code, After:=.Range("B1"), _
LookIn:=xlValues, LookAt:=xlWhole, _
SearchOrder:=xlByRows)
'Si trouvé, vider la cellule contenant le X
If Not cCode Is Nothing Then cCode.Offset(, 3).ClearContents
End With
End If
End Sub