.TintAndShade = 0 End With End If Next myCell End Sub The color value of your RGB values = 10284031 (i.e. the result of R+G*256+B*256*256). You need this to be able to read out color value in each of your cells.
{"__typename":"ForumTopicMessage","uid":1147123,"subject":"Excel Macros If Function Based on Cell Color","id":"message:1147123","revisionNum":1,"repliesCount":4,"author":{"__ref":"User:user:542405"},"depth":0,"hasGivenKudo":false,"board":{"__ref":"Forum:board:ExcelGeneral"},...
Public Function ColorChange()For i = 2 To Cells(1000, 2).End(xlUp).RowIf Cells(i, 2).Interior.Color = 12611584 ThenColorChange = "配料"Exit FunctionEnd IfNextColorChange = ""End Function判断单元格的颜色,现在只能使用vba呢。函数不能判断单元格的颜色。用IF 判断啊
Function fcountCol(color As Range, rng As Range) Dim colorCell As Range Application.Volatile For Each colorCell In rng If colorCell.Font.ColorIndex = color.Font.ColorIndex Then fcountCol = 1 + fcountCol End If Next End Function 查找单元格背景颜色自定义函数: Function fcountBGCol(color As...
End Function 4.保存并关闭VBA编辑界面。四、Excel判断单元格颜色函数的使用方法 1.返回颜色值:在Excel表格中输入函数"=GetCellColor(A1)",其中A1为待判断颜色的单元格。按下回车键后,函数将返回单元格A1的颜色值。2.判断颜色:可以使用条件语句来判断单元格的颜色值,并实现不同的处理逻辑。例如,可以使用IF...
输入公式“=SUMIF($B$11:$G$17,A19,$B$3:$G$9)”并下拉即可。 能去掉辅助行或列吗? 可以!只不过定义名称中的公式就复杂了。 2)复杂公式 步骤: (1)重新定义名称。 定义名称,新创建一个名称“color_2”,然后在引用位置输入如下公式: =SUM((GET.CELL(63,INDIRECT("r"&ROW(Sheet3!$B$3:$G$9)...
Get Cell Color Function Function returns the active cell interior or font color index, regardless of whether it was set by regular or Conditional Formatting.
EachRgIn求和区域SelectCase颜色类型Case"填充"Bol = (Rg.Interior.Color = 参考单元格.Interior.Color)Case"字体"Bol = (Rg.Font.Color = 参考单元格.Font.Color)CaseElse按颜色求和 ="第三参数出错,请检查确认"ExitFunctionEndSelectIfBolThenTotal = Total + Rg.ValueEndIfNext按颜色求和 = TotalEndFunction...
EXCEL操作---如何按照颜色条件汇总函数,在日常处理数据工作中,经常需要对某一条件的数字进行分类或汇总,今天我们就来看看如何按照颜色类别来汇总数据。如下图表的单元格区域,我们想对其中相同颜色的单元格进行汇总。但是要想解决这个问题,靠Excel自带的函数是无法完成的
End If Next icell End Function 2.根据颜色计数代码 Function CountColor(x As Range, ary2 As Range)Application.Volatile For Each i In ary2 If i.Interior.ColorIndex = x.Interior.ColorIndex Then CountColor = CountColor + 1 End If Next End Function 在这里我们定义了SumColor与CountColor两个自定义...