Use the same code above, and just remove the function that unlocks the cells. Again, you can use any different password for this too.

Code:
Private Sub CommandButton1_Click()

    Dim strPassword As String
    Const strActualPassword As String = "ABCD"
    strPassword = InputBox("Please enter the password", "Protect/Unprotect Sheet")
    
    If strActualPassword = strPassword Then
        If Me.CommandButton1.Caption = "PROTECT SHEET" Then
            Me.CommandButton1.Caption = "UNPROTECT SHEET"
            Me.Protect Password:=strPassword
        Else
            Me.CommandButton1.Caption = "PROTECT SHEET"
            Me.Unprotect Password:=strPassword
        End If
    Else
        MsgBox "Invalid Password"
    End If
    
End Sub