Private Sub CommandButton1_Click()
Dim t As String
Dim i As Long
For i = Sheets.Count To 1 Step -1
t = Sheets(i).CodeName
If t = "Feuil1" Or t = "Feuil2" Then
Application.DisplayAlerts = False
On Error Resume Next
Sheets(i).Delete
Application.DisplayAlerts = True
If Err <> 0 Then
MsgBox "Suppression impossible" & vbLf & t & "(" & Sheets(i).Name & ") est la dernière feuille" & vbLf & "Une feuille doit rester visible dans un classeur", , "Information"
End If
On Error GoTo 0
End If
Next i
End Sub