简体   繁体   English

Excel:在格式规则中选择从单元格X开始的列

[英]Excel: Select column starting from cell X in formatting rule

I'm trying to create a rule that formats a row so that it has red background color if the content of another row is "x" . 我试图创建一个规则来格式化行,以便如果另一行的内容是"x" ,则它具有红色背景色。 Unfortunately, the header and empty cells above the table will be included if I simply select =$H:$H="x" as my condition for formatting. 不幸的是,如果我只是选择=$H:$H="x"作为格式化条件,则将包括表格上方的标题和空白单元格。 I want something like: =$H$6:$H$(INFINITY) . 我想要类似的东西: =$H$6:$H$(INFINITY) Is this possible? 这可能吗?

If you want to apply the conditional formatting starting from Row6, while selecting the range for applying the conditional formatting, make sure C6 should be the first cell in the selection ie it should be the active cell in the selection and then make a new rule for conditional formatting using the formula given below. 如果要从第6行开始应用条件格式,同时选择要应用条件格式的范围,请确保C6应该是选择中的第一个单元格,即它应该是选择中的活动单元格,然后为使用下面给出的公式进行条件格式设置。

=$H6="x" = $ H6 =“ x”

Also if you are not sure how far you need to apply this conditional formatting down the rows, would be better if you format your data as an Excel Table, so when the data grows withing the table down the rows, the conditional formatting will also be carried to the new rows added in the table. 另外,如果您不确定需要将此条件格式应用于行的下方,最好将数据格式设置为Excel Table,这样,当数据随表在行下方增长时,条件格式也将是携带到表中添加的新行。

Having a conditional formatting for a unused range on the sheet increases the file size as all the rows contain the conditional formatting and the formula in the background. 在工作表上使用未使用范围的条件格式会增加文件大小,因为所有行都在后台包含条件格式和公式。

You can just use =$H$6:$H$1048576 or =$H$6:$H$65536 while applying conditional formatting. 您可以在应用条件格式设置时仅使用=$H$6:$H$1048576=$H$6:$H$65536 A simplest way of doing this. 一种最简单的方法。

Your formula does lag a lot as you are searching through so many rows down. 在向下搜索这么多行时,您的公式确实滞后很多。 THe best thing you can do is try to limit the amount of rows to search. 最好的办法是尝试限制要搜索的行数。 Ie if you know your dataset only contains max 5000 rows, set the limit to that H6:H5000. 即,如果您知道数据集最多仅包含5000行,则将限制设置为H6:H5000。 This will help. 这会有所帮助。

If the rows change a lot, the best way would be to make it dynamic. 如果行变化很大,最好的方法是使其动态。 Ie make a name range for the range you want to validate and in the name manager, change the range to include offset. 即为要验证的范围创建一个名称范围,然后在名称管理器中更改范围以包括偏移量。 This will help you set the range to be what you have data in. Note: You need to know how many rows (ie use counta) which you will need to figure out if there are blanks at any point. 这将帮助您将范围设置为数据所在的位置。注意:您需要知道多少行(即使用counta),以便在任何时候确定是否有空白。 Otherwise you do the counta on a column where you have no blanks. 否则,请在没有空白的列上进行计数。

Hope this makes sense and easy for you. 希望这对您有意义并且容易。

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

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