我们可以在Excel自定义验证中使用UDF吗 [英] Can we use UDF in excel custom validation

查看:74
本文介绍了我们可以在Excel自定义验证中使用UDF吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用excel插件类库将UDF添加到我的excel模板(C#)中,但是当我在excel的自定义验证中使用UDF时,我无法在自定义验证中使用该功能(数据->验证->下拉列表(自定义))我收到以下错误消息:

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.

这个问题有解决方案吗?我们可以在自定义Excel验证中使用UDF吗?

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

推荐答案

我忘记了UDF-in-data验证限制.我认为该限制已在Excel 2010中删除.否则,AFAIK唯一的解决方法是将UDF包装在xlt中的已定义名称"中(在引用UDF的xlt中创建一个定义名称:NameValidate = MyUDF())

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())

这篇关于我们可以在Excel自定义验证中使用UDF吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆