excel vba protect content code example
Example: excel vba protect content
'Apply protection on worksheet content (cells with Protected = True)
Sheets("Sheet1").Protect Password:="myPassword", _
DrawingObjects:=False, _
Contents:=True, _
Scenarios:=False