Attribute VB_Name = "ProtectAllSheets"
Option Explicit

Public Sub ProtectAllSheets()
    Dim ws As Worksheet
    Dim pwd As String

    pwd = InputBox("Enter a password to protect all sheets:", "Protect All Sheets")
    If pwd = "" Then
        MsgBox "Cancelled — no password entered.", vbExclamation
        Exit Sub
    End If

    For Each ws In ThisWorkbook.Worksheets
        ws.Protect Password:=pwd
    Next ws

    MsgBox "All " & ThisWorkbook.Worksheets.Count & " sheet(s) protected.", vbInformation
End Sub