+ Reply to Thread
Results 1 to 7 of 7

Update Cells after changing UDF

  1. #1
    Registered User
    Join Date
    07-11-2008
    Location
    THE NORTH
    Posts
    52

    Exclamation Update Cells after changing UDF

    Hi,

    I have a UDF in action in a spreadsheet and its used in many places.

    I have amended the code/calculations within my UDF.

    However, the cells dont update automatically.

    In order to update them, I need to select them one by one and press enter on the formula again to get them to update.
    This is rather cumbersome. Is there anyway to get them to update with out me having to select them one by one??


    Thanks

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Update Cells after changing UDF

    Press F9

  3. #3
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Update Cells after changing UDF

    You can add
    Please Login or Register  to view this content.
    at the start of your UDF, but it will recalculate whenever Excel calculates which can slow things down.

    Also, make sure you specify all your arguments.
    Last edited by StephenR; 11-03-2011 at 08:39 AM.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,983

    Re: Update Cells after changing UDF

    Do a Find/Replace and replace = with =
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Registered User
    Join Date
    07-11-2008
    Location
    THE NORTH
    Posts
    52

    Re: Update Cells after changing UDF

    Quote Originally Posted by romperstomper View Post
    Do a Find/Replace and replace = with =
    Thanks for all replies

    @romper

    What do you mean??

    How can I do this since, my function is the same but the cell values will be different.

    e.g.)
    For my UDF the cell refs change.
    =MYUDF($A$1:$A$22, B1:B22)
    =MYUDF($E$1:$E$22, E1:E22)

    etc...

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,983

    Re: Update Cells after changing UDF

    Ctrl+H
    in the Find box: =
    in the Replace box: =
    press Replace All. It will effectively recalculate all the formulas for you.

  7. #7
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,393

    Re: Update Cells after changing UDF

    One additional thought. Make sure everything the UDF needs from the spreadsheet is passed to the UDF through the argument list. This is what Excel uses to figure out the "dependency tree" (is that what it is called?) so it knows what cells need to be calculated when a given cell is changed.

+ 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