+ Reply to Thread
Results 1 to 4 of 4

UDF for pulling value from previous worksheet

  1. #1
    Registered User
    Join Date
    10-08-2010
    Location
    Wisconsin
    MS-Off Ver
    Excel 2007
    Posts
    2

    UDF for pulling value from previous worksheet

    Hello,

    I'm a first time poster long time forum diver. I am trying to write a custom function that will let me get a cell value from X many worksheets back. Something like =Functionname("X","N") where X = how many worksheets to go back and N = the cell address from which to pull the value. I have pretty minimal programming knowledge and have no idea where to start on this one. I usually look for code that gets close to what I need and manipulate it from there but can't find anything like this.........Anyone willing to take a stab at it? I am sure I will /facepalm due to it's simplicity.............

    Thanks,

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: UDF for pulling value from previous worksheet

    Questions:

    what happens if the offset goes back beyond sheet1 (eg to non-existent sheet) - should this then revert to last sheet and work back from there ?

    what happens if there are hidden sheets or chart sheets ?
    should these be ignored in terms of the offset ?
    The morefunc.xll add-in has a SHEETOFFSET function but it will be fairly straightforward to create your own UDF along similar lines - but the above should be outlined first.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: UDF for pulling value from previous worksheet

    Here's one:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    10-08-2010
    Location
    Wisconsin
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: UDF for pulling value from previous worksheet

    shg,

    That UDF is perfect and so versitle! Thanks much for the help.

+ 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