+ Reply to Thread
Results 1 to 3 of 3

How can I call worksheet as function from another worksheet?

  1. #1
    Registered User
    Join Date
    07-03-2007
    Posts
    1

    How can I call worksheet as function from another worksheet?

    I have complicated worksheet which does some long calculations
    I want to call it as function from another worksheet

    Any thoughts would be appreciated.

    Thanks

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,803
    I've thought about this several times myself. I'll be interested to see if others have ideas for accomplishing this sort of thing.

    Without specifics, it's hard to make specific recommendations. To date, my solution for this kind scenario usually involves converting the spreadsheet that I want to call as a "function" into a VBA User-Defined Function. UDF's can be called from any worksheet cell just like native functions.

    The main drawback to using UDF's is that they run significantly slower than native functions (on the order of milliseconds per function call rather than microseconds needed for most native functions). I find this is only noticeable, though, when I have hundreds to thousands of function calls per calculation event.

  3. #3
    Forum Contributor Tarball's Avatar
    Join Date
    04-21-2007
    Location
    Atlanta, GA
    Posts
    166
    You can do this by creating an "Add In" for the function. An add in is something added to a spreadsheet to give it additional functionality. For example, Excel ships with several default add in such as the "Data Analysis" pack. Add ins can be used to store functions and other code for use by other spreadsheets. This type of add in will generate a .xla file.

    You can also develop COM addins using Visual Basic 5.0 (or greater), VB.NET or Office Developer Edition. Building an add in in this manner will essentially generate a DLL file which can then be distributed.

    Read up on building add-ins. Also, buy one of the following two books (both are excellent) and provide in depth instruction on using and building Add-ins

    1. MS-Excel 2003 Power Programming with VBA By John Walkenbach
    2. Professional Excel Development - The Definitive Guide to Developing Applications Using MS-Excel and VBA By Bullen, Bovey, and Green

+ 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