Bonjour,
je n'arrive pas a faire fonctionner mon code, j'ai une erreur
La methode Delete de la Classe Worksheet à echouée
l'erreur s'affiche sur Sheets(i).Delete
Voici le code
Private Sub CommandButton4_Click()
Dim s As Worksheet, t As String
Dim i As Long, K As Long
K = Sheets.Count
For i = K To 1 Step -1
t = Sheets(i).CodeName
If t = "Feuil1" Or t = "Feuil2" Then
Application.DisplayAlerts = False
Application.DisplayAlerts = True
Else
Application.DisplayAlerts = False
Sheets(i).Delete
Application.DisplayAlerts = True
End If
Next i
End Sub
Merci
je n'arrive pas a faire fonctionner mon code, j'ai une erreur
La methode Delete de la Classe Worksheet à echouée
l'erreur s'affiche sur Sheets(i).Delete
Voici le code
Private Sub CommandButton4_Click()
Dim s As Worksheet, t As String
Dim i As Long, K As Long
K = Sheets.Count
For i = K To 1 Step -1
t = Sheets(i).CodeName
If t = "Feuil1" Or t = "Feuil2" Then
Application.DisplayAlerts = False
Application.DisplayAlerts = True
Else
Application.DisplayAlerts = False
Sheets(i).Delete
Application.DisplayAlerts = True
End If
Next i
End Sub
Merci