'specify the cell you want the color for
x = InputBox("what cell")
Range("a1") = Range(x).Interior.Color
If Range(x).Interior.Color = Range("a1") Then
MsgBox "yes the color is right"
End If
数据透视表示例
'where cell is something your looking for that is in the cell
ActiveSheet.PivotTables("PivotTable1").PivotSelect "'cell'", xlDataAndLabel + xlFirstRow, True
x = Selection.Interior.Color
1条答案
按热度按时间rsaldnfx1#
条件格式参数是什么?您可以通过编程方式使用相同的逻辑。或者,您可以编写代码来检查单元格的颜色。
数据透视表示例