在隐藏的单元格上执行查找 [英] Perform a find on hidden cells

查看:102
本文介绍了在隐藏的单元格上执行查找的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在用于下拉框的隐藏列中具有计算值范围.为了弄清楚用户选择了哪个值,我尝试在该范围内运行查找",但是由于某种原因,只要隐藏了该列,Excel就不会返回与其选择相对应的单元格.

I have a computed range of values in a hidden column which I use for a dropdown box. To figure out which value the user has selected, I try to run a Find on that range, but for some reason Excel won't return the cell corresponding with their selection so long as the column is hidden.

如何使Find在隐藏范围内的单元格上工作.记住-我在搜索单元格计算的值,而不是公式.

How can I get Find working on cells in the hidden range. Remember - I'm searching cell calculated values, not formulas.

以下内容无效:

Set inserted = Range("RDS_Event_IDs").Find(Range("SelectedEvent"), , xlValues, xlWhole)

只要Range("RDS_Event_IDs")中的单元格被隐藏.

so long as cells in Range("RDS_Event_IDs") is hidden.

由于该解决方案必须在一般情况下起作用,在这种情况下,可能会隐藏正在搜索的部分或全部范围,并且可能会搜索整个工作表,因此以编程方式取消隐藏所有受影响的行和列是不可行的然后重新隐藏以前隐藏的内容.

Because the solution has to work in general situations, where some or all of the the range being searched might be hidden, and the entire sheet might be searched, it isn't feasible to programmatically un-hide all affected rows and columns and then re-hide the ones that were previously hidden.

推荐答案

根据 Andy教皇(他永远不会错),如果您使用的是xlFormulas,查找"仅适用于隐藏的单元格.也许是比赛?

According to Andy Pope (and he's never wrong) Find only works on hidden cells if you're using xlFormulas. Perhaps a Match instead?

Set inserted = Cells(Application.WorksheetFunction.Match("SelectedEvent", Range("RDS_Event_IDs"), 0), Range("RDS_Event_IDs").Column)

这篇关于在隐藏的单元格上执行查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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