You may have already found out that changing a cell's interior color doesn't fire a Sub Worksheet_Change(...)
. As no value is changed, nothing gets recalculated. In this case not even the Application.Volatile
is of help.
The best approach might be to use a Worksheet_SelectionChange(...)
, eventually in combination with Worksheet_Activate(...)
and Worksheet_Deactivate(...)
(to have the sheet clean upon entry and leave) to call for an enforced recalculation, e.g.
Sub DoMyRecalc()
' Range("OutputRange").Calculate ' all uses of countCcolor() within that range
' [H3].Calculate ' countCcolor() only used in cell H3
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
DoMyRecalc
End Sub
Private Sub Worksheet_Activate()
DoMyRecalc
End Sub
Private Sub Worksheet_Deactivate()
DoMyRecalc
End Sub