Excel & EPPlus .NET library: Advanced DropDown list validation

倾然丶 夕夏残阳落幕 提交于 2019-12-01 05:30:12
I3i0

I did it with the following code:

//ExcelWorksheet ws
var validation = ws.DataValidations.AddListValidation(cell.Address);
//Error handling
validation.ShowErrorMessage = true;
validation.ErrorStyle = ExcelDataValidationWarningStyle.stop;
validation.ErrorTitle = "Error";
validation.Error = "Error Text";
// sheet with a name : DropDownLists 
// from DropDownLists sheet, get values from cells: !$A$1:$A$10
var formula = "=DropDownLists!$A$1:$A$10";
//Applying Formula to the range
validation.Formula.ExcelFormula = formula;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!