PC Review


Reply
Thread Tools Rate Thread

custom function doesn't update value when source value changes

 
 
Mark Kubicki
Guest
Posts: n/a
 
      30th May 2008
i seem to remember that there needs to be some line of code addied for this
to occur

thanks in advance,
mark
 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      30th May 2008
Application.Volatile

This MAY help.
--
Gary''s Student - gsnu200789


"Mark Kubicki" wrote:

> i seem to remember that there needs to be some line of code addied for this
> to occur
>
> thanks in advance,
> mark

 
Reply With Quote
 
Jim Thomlinson
Guest
Posts: n/a
 
      30th May 2008
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...
--
HTH...

Jim Thomlinson


"Mark Kubicki" wrote:

> i seem to remember that there needs to be some line of code addied for this
> to occur
>
> thanks in advance,
> mark

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
When I add a row to my source sheet, it doesn't update my linked . WorkingGirl4774 Microsoft Excel Misc 2 21st Nov 2008 11:37 PM
VBA custom status bar doesn't update properly TFriis Microsoft Powerpoint 3 24th Oct 2008 09:43 AM
Office Update function doesn't update the Outlook '03 junk email f =?Utf-8?B?TWFydHkgUw==?= Microsoft Outlook Discussion 0 31st Mar 2005 03:51 AM
View Source doesn't function Brett Windows XP Internet Explorer 2 7th Apr 2004 03:45 PM
VB .NET Databinding source doesn't update lisu Microsoft VB .NET 0 13th Nov 2003 10:43 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:22 PM.