Attribute VB_Name = "testsheetope2" Sub ƒeƒXƒg() Dim sheet1 As Worksheet Set sheet1 = Worksheets("Sheet1") sheet1.Protect Password:="pass", _ AllowFormattingCells:=True End Sub