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. Try this one: Sub ColorMacro() Dim myCell As Variant
With Application.ReplaceFormat .Interior.Color = RGB(255, 255, 255) With .Font .Color = RGB(255, 0, 0) .Bold = True .Italic = True End With End With Range("SearchRange").Replace What:="", Replacement:="", _ SearchFormat:=True, ReplaceFormat:=True, _ FormulaVersion:=xlReplaceForm...
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 判断啊
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)...
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...
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.
就是cell(x,y).font.color = rgb(255,0,0)具体可以AI一下在到期日如图设置条件格式首先,日期输入...
=GET.CELL(63,C2) 在D2输入公式,下拉。这样有背景色的就大于0。 这样就可以对多种颜色进行条件求和。 =SUMIF(D:D,颜色,C:C) 使用宏表函数,必须另存为xlsm格式。 具体问题,具体分析。即使是带颜色求和,也有多种情况,针对不同情况使用不同方法。
End Function Function SumColor(col As Range, sumrange As Range) As Integer Dim icell As Range Application.Volatile For Each icell In sumrange If icell.Interior.ColorIndex = col.Interior.ColorIndex Then SumColor = Application.Sum(icell) + SumColor ...