+ Reply to Thread
Results 1 to 2 of 2

Get value of cell containing UDF without circular reference

  1. #1
    Registered User
    Join Date
    11-08-2018
    Location
    London
    MS-Off Ver
    Microsoft for Mac 2011
    Posts
    14

    Get value of cell containing UDF without circular reference

    Hello,

    I have a simple UDF that performs a http request to return a value to a cell. Whenever the cell recalculates I'd like to compare the old and new values in the cell to see whether there has been a change, the code looks roughly something like this:

    Please Login or Register  to view this content.
    The issue I'm having is that requesting the Value of a Range that contains a UDF will trigger a recalculation, and if this is placed inside the UDF (as above) then it will result in a circular reference which will crash Excel.

    I've noticed that the same thing happens when using Application.Caller.Value2. Only Application.Caller.Text seems to work, although it's less useful because I need the pre-formatted values.

    Is there a way to get the value of a cell without a recalculation? Excel must store this somewhere because if you reformat a value returned from a UDF then it doesn't require a recalculation (e.g increasing the number of decimal point 22.45 -> 22.445).
    Last edited by gordonbe; 02-19-2019 at 06:15 AM.

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Get value of cell containing UDF without circular reference

    You can't get the value from the function that returns the value. Text is your only option other than storing the old value in a variable.
    Rory

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. circular reference within a cell using VBA
    By saaadi1616 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-11-2017, 03:12 AM
  2. [SOLVED] cannot resolve circular reference Cell AP35
    By hmr2662 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-16-2014, 01:50 PM
  3. Replies: 4
    Last Post: 03-07-2014, 06:57 PM
  4. Replies: 2
    Last Post: 02-23-2014, 06:06 PM
  5. Replies: 1
    Last Post: 08-21-2007, 07:22 PM
  6. Circular Cell Reference
    By karstens in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-15-2007, 09:42 PM
  7. circular error w/o cell reference
    By Remote Todd in forum Excel General
    Replies: 1
    Last Post: 08-11-2005, 08:05 AM

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