Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default custom function doesn't update value when source value changes

i seem to remember that there needs to be some line of code addied for this
to occur

thanks in advance,
mark
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default custom function doesn't update value when source value changes

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default custom function doesn't update value when source value changes

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
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
Update source in VBA Lost Excel Discussion (Misc queries) 7 April 28th 09 04:46 AM
Why will links not update unless source is open? WesJFrank Excel Discussion (Misc queries) 4 August 3rd 07 03:14 PM
Auto Update of Source File Name Richard Excel Worksheet Functions 1 April 16th 07 03:48 PM
Change Source / Update Now buttons not available stickboy Links and Linking in Excel 0 February 16th 06 10:33 PM
update control source value Christy Excel Programming 0 September 22nd 05 05:37 PM


All times are GMT +1. The time now is 10:18 AM.

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

About Us

"It's about Microsoft Excel"