Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

custom function doesn't update value when source value changes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark Kubicki - 30 May 2008 16:44 GMT
i seem to remember that there needs to be some line of code addied for this
to occur

thanks in advance,
mark
Gary''s Student - 30 May 2008 17:01 GMT
Application.Volatile

This MAY help.
Signature

Gary''s Student - gsnu200789

> i seem to remember that there needs to be some line of code addied for this
> to occur
>
> thanks in advance,
> mark
Jim Thomlinson - 30 May 2008 17:07 GMT
There are 2 ways to make a user defined function update. The one you are
thinking of is adding Application.Volatile to the function. This means that
the function will recalculate every time a calculation runs anywhere. There
is a lot of overhead added by doing this.

The other method is to add the appropriate range arguments to your funtion
something like this

Public Function MySum (byval SumRange as range) as double
MySum = Application.sum(sumrange)
end Function

Now if you use it in a spreadsheet something like this...
=MySum(A1:A10) any changes to the range A1:A10 will trigger this function to
recalculate. This is a much better method than making the funciton volatile...
Signature

HTH...

Jim Thomlinson

> i seem to remember that there needs to be some line of code addied for this
> to occur
>
> thanks in advance,
> mark
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.