简体   繁体   English

不使用VBA在excel中格式化单元格颜色

[英]formatting the cell color in excel without VBA

I have a client situation where I can not use the VBA code and have to change the formatting of cells. 我的客户情况是我无法使用VBA代码,而不得不更改单元格的格式。 The data is NxM with row headers. 数据为带有行标题的NxM。 In each of the rows I have to color 1st maximum value as RED, 2nd maximum value as BLUE and 3rd maximum value as YELLOW. 在每一行中,我必须将第一个最大值着色为RED,将第二个最大值着色为BLUE,将第三个最大值着色为YELLOW。 Assume the row wise data is unsorted, non repeated and of data type LONG. 假设按行数据是未排序的,不可重复的并且数据类型为LONG。 Progress so far: I have calculated 1, 2 , 3 maximum using HLOOKUP and MAX functions. 到目前为止的进展:我已经使用HLOOKUP和MAX函数计算了最大值1、2、3。 Based on these values and conditional formatting I have created the attached sample matrix. 基于这些值和条件格式,我创建了附加的样本矩阵。 From this I was trying to copy the FORMAT and apply it to the original data but failed in doing so. 由此,我试图复制FORMAT并将其应用于原始数据,但是这样做失败。 The attached images are just sample data not the original one and the above mentioned assumptions holds. 所附图像仅是示例数据,并非原始图像,上述假设均成立。 在此处输入图片说明

在此处输入图片说明

Try using conditional formatting: 尝试使用条件格式:

Create 3 new rules and apply each to columns A1:K<lastRow> : 创建3个新规则,并将每个规则应用于A1:K<lastRow>列:

=INDIRECT(CHAR(COLUMN()+64) & ROW()) = INDIRECT("M" & ROW())

=INDIRECT(CHAR(COLUMN()+64) & ROW()) = INDIRECT("N" & ROW())

=INDIRECT(CHAR(COLUMN()+64) & ROW()) = INDIRECT("O" & ROW())

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

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