0
我一直在試圖改變下面的函數來計算,而不是按「標準」中定義的任何顏色vbRed:ALTER函數計算vbRed
Function CountCcolor(range_data As Range, criteria As Range) As Long
Dim datax As Range
Dim xcolor As Long
xcolor = criteria.Interior.ColorIndex
For Each datax In range_data
If datax.Interior.ColorIndex = xcolor Then
CountCcolor = CountCcolor + 1
End If
Next datax
End Function
變化,如下面的一個失敗:
Function CountRed(range_data As Range) As Long
Dim datax As Range
For Each datax In range_data
If datax.DisplayFormat.Interior.Color = vbRed Then
CountRed= CountRed+ 1
End If
Next datax
End Function
真棒!謝謝! – RTrain3k