AddProtectedRange
function AddProtectedRange(sTitle: string = null, sDataRange: string = null): ApiProtectedRange | "null"
Description
Creates a protected range of the specified type from the selected data range of the current sheet.
Parameters
- sTitle
string
null The title which will be displayed for the current protected range.
- sDataRange
string
null The selected cell range which will be used to get the data for the protected range.
Returns
ApiProtectedRange | "null"
Try It
var oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("A1").SetValue("1");
oWorksheet.GetRange("B1").SetValue("2");
oWorksheet.AddProtectedRange("protectedRange", "Sheet1!$A$1:$B$1");