在Excel中按大纲级别(组)着色 [英] Color by Outline Level (group) in Excel
问题描述
我想在excel中根据单元格的轮廓级别更改单元格的颜色,轮廓级别是指列分组的级别.
I would like to change the color of a cell based on its outline level in excel, by outline level i mean the level of the column grouping.
我正在尝试使用ActiveCell.OutlineLevel属性在ColorByValue滤镜中使用.
I am trying to use the ActiveCell.OutlineLevel property to use in a ColorByValue filter.
这可能吗?或者,是否可以通过VBA或函数来做到这一点?
is this possible? or, is there a way to do this via VBA or function?
推荐答案
感谢JMax,我根据您的建议得到了解决方案!...
Thanks JMax i got the solution based on your advice!...
1-将条件格式设置规则添加到需要格式化的单元格中.
1- Add Conditional Formatting Rule into the cell that requires the formatting.
=OutlineLevel(CELL("col",CV1)) = 1
2-公式引用了一个小的函数,该函数输出行分组级别.
2- The formula references a small function that outputs the rows grouping level.
Function OutlineLev(inp As Integer) As Integer
OutlineLev = Columns(inp).OutlineLevel
End Function
有人能找到更优雅的解决方案吗?
Can anyone find a more elegant solution?
这篇关于在Excel中按大纲级别(组)着色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!