View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.misc
Bernie Bernie is offline
external usenet poster
 
Posts: 47
Default How to call a worksheet (as a function)

Its a massive financial calculation, up to 30 worksheets and uses a lot of
functions and operators and conditionals. It takes 2 parameters as input and
produces one result output. I want to call this massive function over and
over again from within the same workbook, but with different input parameters
(and lets say chart the output or create a table of the output). Thanks

"Jacob Skaria" wrote:

Sorry, could you please let us know what the calculation is about..and what
formula is used..
--
If this post helps click Yes
---------------
Jacob Skaria


"Bernie" wrote:

Does UDF require VBA programming? The calculation is about 30 worksheets
long, and about 50 lines on each worksheet, and 200 cells on each line. Are
you saying I have to rewrite 300,000 cells or thousands of arrays in VB?

Now I am really confused. If I already have a working set of worksheets,
why do I have to rewrite the whole thing into VB to make a UDF out of that?

If I just have to have a 1 liner VBA, could you then pls. write it for me,
and tell me how to enter that into Excel? Thanks a lot.

thanks

"Jacob Skaria" wrote:

You cannot pass values to a calculation residing in another workbook. You can
acheive this by using user defined functions. The complex calculations needs
to be written as User Defined functions UDFs

If this post helps click Yes
---------------
Jacob Skaria


"Bernie" wrote:

Hi Jacob - But everytime I refer to this worksheet, I want to pass it a
different parameter (i.e. the values in column A and B in the calling
worksheet). So for example the 4th row of the caller will want to pass the
value (4,14) to WS. (what you have indicated tells me how to use the return
values - so thanks for this part).

"Jacob Skaria" wrote:

Referencing another open workbook named workbook.xls

='[Workbook.xls]Sheet1'!$A$1

If this post helps click Yes
---------------
Jacob Skaria


"Bernie" wrote:

This is a very fundamental question. If I have a worksheet (or a set of
worksheets) containing a complicated calculation, how do I refer to this
calculation from elsewhere with different input values (i.e., how do I call
this worksheet) and get its results?

Example: A worksheet called WS has input cells A1 through A2, and results
appear in B1 to B2.

In another worksheet I have a table with 10 rows and 4 columns. Column A
has values 1 thru 10, column B values 11 thru 20. column C is the result of
"calling" WS with the values A and B of the same row, and should receive the
B1 value of WS. column D again calls WS, but displays the B2 value.

I don't want to make 10 copies of the very complicated set of worksheets WS.

How do I "call" a worksheet and obtain one of many resulting value? I do
not want to do macro programming or VBA programming as it should be
unnecessary (I am doing spreadsheet programming already).

Thanks for all the help, in advance.