简体   繁体   English

基于下拉列表值的不可见表

[英]Invisible table based on drop-down list value

There is a drop-down list with numbers that was made using Data-> Data validation. 有一个下拉列表,其中包含使用“数据”->“数据验证”创建的数字。 The goal is to make visible only the number of rows of the table that was chosen from drop-down list without using vba (to make it more easily to edit by ordinary users). 目的是仅显示从下拉列表中选择的表的行数,而不使用vb​​a(以使普通用户更容易地对其进行编辑)。 The first column of the table contains numbers corresponding to the numbers from the drop-down list. 该表的第一列包含与下拉列表中的数字相对应的数字。 The table also contains the columns with formulas. 该表还包含带有公式的列。 I choosed to use conditional formating with idea that all the cells of the table will be calculated and then hide those rows of the table that are under the row corresponding to the value of cell with drop-down list. 我选择使用条件格式的想法是,将计算表的所有单元格,然后隐藏表中与带下拉列表的单元格的值相对应的行下方的那些行。 In other words it needs to dynamically change the visible rows of the table or to dynamically form the table (but there is a columns with formulas and I don't know if you can do that without using vba). 换句话说,它需要动态更改表的可见行或动态形成表(但其中包含带有公式的列,并且我不知道您是否可以在不使用vb​​a的情况下执行此操作)。 I've tried different ways but this problem seems difficult for me. 我尝试了不同的方法,但是这个问题对我来说似乎很困难。 Maybe instead of ordinary table you need to use smart-table or power pivot but I don't have experience of using it. 也许您需要使用智能表或电源枢轴来代替普通表,但是我没有使用它的经验。 Thank You for Your help! 谢谢您的帮助!

Ok... let's asume you have the value in A1 . 好的...假设您拥有A1的值。

Now for the range of B2:G20 . 现在为B2:G20的范围。
Conditional formatting formula: =ROW()>$A$1 条件格式公式: =ROW()>$A$1

In the range of B2:G20 every cell will be formated with a row higher than the value in A1 B2:G20的范围内,每个单元格的格式将比A1的值高

If the format is something like ; ; ; 如果格式是类似的; ; ; ; ; ; it looks empty. 它看起来是空的。

Using this example and having 11 in A1 -> B12:G20 will be hidden. 使用此示例并隐藏A1中的11-> B12:G20

However: to set Row.Hdden = true you need to do it manually or use VBA :/ 但是:要设置Row.Hdden = true您需要手动执行或使用VBA:/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM