LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default UDF, dependency sequence, IsEmpty() & Multi-areas ranges

Hi there,
I have a UDF that takes a long time to execute and I need to make sure
it is not evaluated more than required per workbook calculation.
I found on www.decisionmodels.com/calcsecretsj.htm that I can use
IsEmpty(arg) to detect that my inputs arguments are 'dirty' (i.e. have
not been recalculated yet) and therefore that it is not worth
performing the full procedure and rather exit early, and wait to be
called again when the argument is 'clean':

Public Function myfunction(arg1 As Range, arg2 As Range)
Debug.Print "entry"
If IsEmpty(arg1) Or IsEmpty(arg2) Then
Debug.Print "exit on dirty"
Exit Function
End If
' ...proper procedure there
Dim inc As

It seems to work fine on simple inputs arguments, yet it seems to be
ineficient if the input argument is a multi areas range: IsEmpty
returns false although I'm sure some of the cells have not been
recalculated yet.
Would it be enough to test all the areas in the input? What about
multi-cell ranges, do I need to test every single cell?

Is there a more efficient way to optimise excel recalculation
sequence?

Thanks

Thomas
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
multi-cell named ranges Santa-D Excel Worksheet Functions 1 December 14th 06 02:22 AM
Countif & ranges consisting of multiple areas Jurry Excel Worksheet Functions 2 November 15th 04 03:24 PM
Countif & ranges consisting of multiple areas Jurry Excel Worksheet Functions 0 November 15th 04 12:39 PM
Countif & ranges consisting of multiple areas Jurry Excel Worksheet Functions 1 November 15th 04 12:25 PM
Countif & ranges consisting of multiple areas Jurry Excel Worksheet Functions 1 November 15th 04 09:03 AM


All times are GMT +1. The time now is 02:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"