Can we use UDF in excel custom validation

╄→гoц情女王★ 提交于 2019-12-13 02:16:25

问题


I have added the UDF in my excel template(C#) using excel addin classlibrary,but i can not use that function in custom validation when i use the UDF in custom validation of excel(data->validation->dropdownlist(custom))i get an error as:

You can not use references to other worksheeta or workbooks for data validation criteria.

Is there any solution to this problem? Can we use UDF in custom validation of excel?


回答1:


I had forgotten about the UDF-in-data validation restriction. I think that restriction has been removed in Excel 2010. Otherwise AFAIK the only way round it is to wrap the UDF in a Defined Name in the xlt (create a Defined Name in the xlt that references the UDF: NameValidate=MyUDF())



来源:https://stackoverflow.com/questions/4647693/can-we-use-udf-in-excel-custom-validation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!