+ Reply to Thread
Results 1 to 10 of 10

udf stopped updating

  1. #1
    Registered User
    Join Date
    01-12-2009
    Location
    uk
    MS-Off Ver
    Excel 2003
    Posts
    28

    udf stopped updating

    I have made a series of of udf's and used them without a problem in my worksheet. One of the variables used by udf's, " commission " is a named range on the "vrs" sheet in my book. All was working fine, all the udfs updated whenever i changed the value of "commission" by directly entering a new value in the cell referenced by "commission" I then wrote sub to call an input box wich collected a value for commission and put it in the ranged cell. Since then, of the 4 columns of data that commission acts on only 3 now update automatically. The recalcitrant 4th column will only update if I select the cell, place the cursor anywhere in the formula and press enter.

    Could anyone please tell me why this is so, and what the remedy is. Thanks for all and any help.
    Last edited by smileyc; 03-19-2009 at 05:41 AM. Reason: to flag as solved

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: udf stopped updating

    Not without seeing the code, and some sample data.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: udf stopped updating

    Hi,

    Are all the arguments for the UDF included in the argument list following the function name?

    UDFs are notoriously tricky when it comes to the area of volatile functions and dependencies.

    Check out the following explanation on Charles Williams excellent site:

    http://www.decisionmodels.com/calcsecretsj.htm

    If you're still struggling after this, post back attaching your workbook

    Rgds
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    01-12-2009
    Location
    uk
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: udf stopped updating

    Richard thank you for the link to the site, I found my answer there.

  5. #5
    Registered User
    Join Date
    09-30-2012
    Location
    VENEZUELA
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    10

    Re: udf stopped updating

    Hi Richard,

    Is there any chance you could post the updated reference your link? I'm having the same problem that smileyc, and nothing seems to workout.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: udf stopped updating

    Quote Originally Posted by rubedario_86 View Post
    Hi Richard,

    Is there any chance you could post the updated reference your link? I'm having the same problem that smileyc, and nothing seems to workout.
    Does the link in post # 3 not work?

  7. #7
    Registered User
    Join Date
    09-30-2012
    Location
    VENEZUELA
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    10

    Re: udf stopped updating

    Indeed Richard,

    Or at least not for me in Venezuela.

  8. #8
    Registered User
    Join Date
    09-30-2012
    Location
    VENEZUELA
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    10

    Re: udf stopped updating

    Richard,

    I am developing an application for fill in some worksheets using a chemical process simulator. In order to give our customer the information, we need to pass this simulator data into the datasheets (same info, nicer presentation).. In this development I use some UDF and the user wants to drag these functions, to speed things up. When dragging the formula to other cells, not very value is updated.

    Here is an example of the type of function I'm using. In this application, I use a dummy argument, but is only to try to push VBA to update the value.


    Function test(indx As Range) As String
    Dim acll As Object, pcll As Object
    Dim comp(1 To 9) As String
    Dim n As Integer

    comp(1) = "METANO"
    comp(2) = "ETANO"
    comp(3) = "N-PROPANO"
    comp(4) = "I-PROPANO"
    comp(5) = "N-BUTANO"
    comp(6) = "I-BUTANO"
    comp(7) = "N-PENTANO"
    comp(8) = "N-HEXANO"
    comp(9) = "N-HEPTANO"

    n = -1

    Set acll = ActiveCell
    Set pcll = ActiveCell.Offset(n, 0)

    Do While n < 0
    af = acll.Formula
    pf = pcll.Formula

    If Left(af, 4) = Left(pf, 4) Then
    n = n - 1
    Set pcll = ActiveCell.Offset(n, 0)
    Else
    n = Abs(n)
    End If
    Loop

    test = comp(n)

    End Function

    The idea behind this function is to check if it was already use in a previous cell, and if it has been used, print the following sustance tag. If not, print the first one on the list. If you copy this code in VBA, apply that function into any worksheet and drag it, the result for every cell will be METANO. Then, if you go to the formula bar, put the cursor on the formula and click enter, each cell will change its value accordingly.

    Perhaps you've seen this kind of behivior before and you culd help me.

    Regards,

    Rubén

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: udf stopped updating

    Hi,

    You've committed a couple of mortal sins....

    You've jumped into someone else's 4 year old thread with what appears a somewhat different question, albeit to do with UDFs, and you've not wrapped your VBA code in code tags.

    Can I suggest you start your own new thread and upload the workbook in question along with some notes as to what you say the problem is. It may of course not need a UDF at all but we'll only know when we see the question in context.

  10. #10
    Registered User
    Join Date
    09-30-2012
    Location
    VENEZUELA
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    10

    Re: udf stopped updating

    Hi Richard,

    I have already made my own post. I apologize fior the sins. Thanks anyway.

    Regards,

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1