• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User


  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA function not auto updating


New Member
I have written a function in vba for sum based on cell interior colour.
But when i fill colour to another cell in the selected range then sum is not auto updating.
When i click on sum colour cell then it is updating.
Please help to auto update the sum when i add color to cell in given range.



Excel Ninja
Staff member
If you are only applying it to a small range you could try the example to monitor cell colors described here


New Member
>>> use code - tags <<<
Function sumcolor(cellcolor as range, rRange as range)
Dim csum as double
Dim colindex as integer
Colindex= cellcolor.interior.colorindex
For each cl in rRange
If cl.interior.colorindex=colindex then
Csum= worksheetfunction.sum(cl,csum)
End if
Next cl
Sumcolor= csum
End function
This is the code i have witten
Last edited by a moderator: