AutoCalculate on Custom Function

Oscargriz

New Member
Joined
Oct 22, 2008
Messages
14
I have downloaded a bit of code that would sum a range based on the background color. The "Sum" portion of the function works on change now that I added "Application.Volatile" to the top of the code, however if I change the color of a cell, it doesn't recalculate.

I considered doing a Change Event, however I'm not sure how I need to reference the background color as the item that is changing. Any help here would be appreciated.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Changing the background colour of a cell does not trigger any events you can trap, which is the main reason I always advise against this sort of setup. It's much better to have the contents of the cell (or another cell) as an indicator and use that to colour the cells. Your functions can then work directly off the cell contents.
 
Upvote 0
Would it be possible then to loop the formula so that any time a new cell is made active, the formula recalculates?
 
Upvote 0
You could make the SelectionChange event of the worksheet issue a Calculate command, if you really want to stick with this method.
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,803
Members
449,048
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top