I want to apply this formula to all C3 cells excluding header '=IF(ISBLANK(B3), "", 10)' to my spreadsheet.
How can I achieve that?
I want to apply this formula to all C3 cells excluding header '=IF(ISBLANK(B3), "", 10)' to my spreadsheet.
How can I achieve that?
On
This is what I have finally come to:
worksheet.Cells.GetSubrange("C2", "C5000").Formula = $@"=IF(ISBLANK(B2:B5000 ), """", {10})";
worksheet.DataValidations.Add(new DataValidation(worksheet.Columns[5].Cells.GetSubrange("C2", "C5000"))
{
Type = DataValidationType.WholeNumber,
Operator = DataValidationOperator.Equal,
InputMessageTitle = "Edits Not Allowed",
InputMessage = "Value in the cell cannot be changed",
ErrorTitle = "Edits Not Allowed",
ErrorMessage = "Value in the cell cannot be changed"
}); ;
Try this: