軟體: Excel
版本:365
想要自訂一個函數來計算選取範圍中含目標顏色的儲存格數量
Function FontColorCount(rng_c As Range, cell_a As Range)
Dim qty As Integer
Dim cel As Range
qty = 0
For Each cel In rng_c
If cel.Font.ColorIndex = cell_a.Font.ColorIndex Then
qty= qty + 1
FontColorCount = qty
End If
Next cel
End Function
但是運行後好像發現公式只能計算出原有儲存格文字設定的顏色,若是用條件化格式改變字
https://m.imgur.com/a/KPK6Thc
希望版上各位前輩能指點一下怎麼調整語法
十分感謝