+ Reply to Thread
Results 1 to 3 of 3

Function that returns the name of the named formula calling it?

Hybrid View

  1. #1
    Registered User
    Join Date
    09-05-2013
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    7

    Function that returns the name of the named formula calling it?

    Hello again!

    I've spent a good portion of the last few work days searching this site and others in an effort to streamline the way we set up our spreadsheets, and I've had quite a bit of luck on here so far. I have one more idea that would make things perfect if there's a way to get it to work, but I hit a road block.

    I'm still largely a VBA newbie, as in our department, it's best if we can avoid it altogether, and I pride myself on being able to do as much as I currently can without it. In this case, however, it would be insanely clunky to go about it without UDFs.

    So here's what I need: A function that returns the name of the named formula that calls the function. A funky parent-referencing function. A bizarre version of ROW(), I guess.

    Something along the lines of:

    Function FuncX() As String

    FuncX = NameOfActiveFormula

    End Function

    So putting "=blarg" in a cell, where the name "blarg" = 1&FuncX()&2, the cell would read "1blarg2"

    I don't even know if the "active formula" is something that gets stored in Excel's memory.

    There will be multiple names using this structure within a single cell, if that's important.

    So far I've figured out how to get a named formula's name by calling a function and passing a string matching its name, but that's not terribly useful. I've also figured out how to return a named formula's "refers to" as a string by calling a function and passing a string matching its name. I feel like these two functions might come in handy at some point in this process, but I'm not certain. Point is, both of these functions need an argument, and I need one that doesn't.

    If it did indeed work, obviously it wouldn't work on its own, it would only work when a named formula is calling it... but that's all I need. Any ideas? If it's just plain not possible, that's a-okay, I just don't want to stop trying until I know for sure!

    An important note: There are no named ranges being used, only named formulas that don't refer to any specific cell(s), and I would prefer it to stay that way, but it's not out of the question.

    Thanks so much for your time!

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,332

    Re: Function that returns the name of the named formula calling it?

    May I ask what the point of this is? What do you intend to use it for?
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    09-05-2013
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Function that returns the name of the named formula calling it?

    Just as I came back to check this, I had a realization that I'm really, really over-thinking this.

    Now, each named formula that would have been using the function is an index of the row in which it's being used, and a MATCH of its own name (sans underscores) within the first row of the sheet, with a range of the entire sheet. These are going to be used to simplify the creation, reading, and troubleshooting of formulas for users within our department.

    We make these spreadsheets of dimensions and pricing for our products and use them as test sheets against our ordering program to make sure everything the program has is valid. Each row is one possible set of dimensions/choices/prices for a particular product, and many of the values in each row play off of one another, so calling them by name instead of cell, while not necessary, would be handy. I'm in the process of streamlining the old spreadsheets and creating a new standard, because wow are there some messes.

    Generally, I'm pretty good at this simplifying/streamlining thing... but I do have my off times, lol

    I don't even want to describe what I had going on before. It was a Rube Goldberg machine of Excel names and functions! It was going to be streamlined to the eye, but behind the scenes... yikes.

    I am still curious, however, if my original idea is possible!

+ 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. [SOLVED] help with calling a function (B) and return control of program flow to the calling functio
    By john/nyc in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-26-2012, 11:06 AM
  2. Arrays elements is not returns the values to Calling function
    By amarendra19 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-21-2011, 12:44 AM
  3. Calling Named Ranges
    By den88 in forum Excel General
    Replies: 5
    Last Post: 12-02-2010, 01:29 PM
  4. Lets XLL function believe I am calling it from an array formula
    By toto_fr_2002 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-25-2010, 06:16 PM
  5. Replies: 0
    Last Post: 12-16-2005, 01:45 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