Function SheetsProtection(bProtect As Boolean, ParamArray SheetsNames() As Variant) As Boolean
SheetsProtection = False
Dim i As Integer
Dim ActualSheet As String
ActualSheet = ActiveSheet.Name
On Local Error Resume Next
For i = LBound(SheetsNames) To UBound(SheetsNames)
Sheets(SheetsNames(i)).Select
If Err.Number = 9 Then Err.Clear: Exit Function
If bProtect Then ActiveSheet.Protect Else ActiveSheet.Unprotect
Next i
Sheets(ActualSheet).Select
SheetsProtection = True
End Function
Sub Exemple_Utilisation()
' *** Retourne True ou False, suivant le déroulement de la fonction
' vous pouvez mettre autant de feuilles que vous le souhaitez
MsgBox SheetsProtection(True, "Feuil1", "Feuil3")
MsgBox SheetsProtection(False, "Feuil1", "Feuil3")
End Sub