Excel条件格式可以在条件中使用UDF吗? [英] Can Excel Conditional Formatting use UDFs in the condition?

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

问题描述

我在Excel中有一个单元格,希望根据用户定义的公式(UDF)设置不同的格式-我的公式测试该单元格中是否有公式...

I have a cell in Excel that I want to format differently based on a user defined formula (UDF) - my formula tests whether there is a formula in the cell...

我正在尝试对UDF使用条件格式来格式化单元格-但它似乎无法正常工作。

I am trying to use conditional formatting with my UDF to format the cell - but it does not seem to be working.

我的条件是:

="isManualPrice(R22C12)"

我尝试了不带引号的操作,但出现错误

I tried without the quotes, but get the error


您不能使用对其他
的引用
条件格式标准的工作表或工作簿

You cannot use references to other worksheets or workbooks for Conditional Formatting criteria

也许问题出在单独的宏工作簿中定义了我的UDF,而不是我的主要工作簿...

Perhaps the issue relates to my UDF being defined in a separate macro workbook and not my main workbook...

我在 2005年的博客条目,但仅是通过...

I see its mentioned in this blog entry from 2005, but only in passing...

在此先感谢。
克里斯

Thanks in advance. Chris

推荐答案

是的,可以。

您的问题很简单,就是那里有引号。您需要从下拉列表中选择公式是,然后您的公式应该是

Your problem is simply that you've got quotes in there. You need to choose "Formula Is" from the drop-down, and then your formula should be

=isManualPrice(R22C12)

...没有引号。

(我更习惯于A1表示法,而不是R1C1表示法,但我认为这样做也一样。)

(I'm more used to A1 notation rather than R1C1 notation but I assume that'll work just as well).

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

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