PDA

View Full Version : help with re-calculating Excel UDF



alienscript
11-04-2009, 11:16 AM
Hi VBA community!

In the worksheet I have a UDF to count the number of cells filled with the different color background. However, sometimes when I added or removed some colors, or deleting rows, the code below didn't work to recalculate the UDF, except when I pressed F2 and press Enter.

Appreciate any help with a code how to allow the UDF to recalculate when I press the common button. I'm using Excel 2003.

Thanks!



Application.Volatile
Application.Calculate
ActiveWorkbook.RefreshAll

GTO
11-04-2009, 09:38 PM
Maybe try:


Application.CalculateFull


Hope that helps,

Mark

alienscript
11-04-2009, 10:11 PM
Thanks GTO! It works.

GTO
11-04-2009, 10:17 PM
:thumb Happy to help!