Output from a procedure



Hi everyone:

I am writing a VBA code as a function in excel. The function has two
arguments, Arg1 which is the input to the function, and Arg2 which is an
output from the function along with the function name. In excel, I call the
function in the formula bar as:
=MyFunct(Arg1, Arg2)
Now, in the cell that contains the function, the value of the function is
returned. However, I was wondering if there is any way of also getting the
output value from Arg2. Of course, one way is to have the user send in a
cell number, and inside the function to return that value. But, I was
wondering may be there is a better way.

I appreciate all your help.

Bob


.



Relevant Pages

  • Re: Yet another basic problem
    ... Public function test (arg1 as range, arg2 as range) ... Then you have to enter the function and arguments in cell C2. ... I have a very basic question concerning the VBA code in excel. ...
    (microsoft.public.excel.programming)
  • Re: Output from a procedure
    ... arguments, Arg1 which is the input to the function, and Arg2 which is an ... In excel, I call the ... Now, in the cell that contains the function, the value of the function is ... output value from Arg2. ...
    (microsoft.public.office.developer.vba)
  • RE: What is a Sub
    ... I tried entering your example in Excel ... Sub Myfunction ... Then in Cell D1 I inserted all three ... arg2 ' no value returned ...
    (microsoft.public.excel.programming)
  • Re: Yet another basic problem
    ... Look at the Data>Table command ... Public function test (arg1 as range, ... Then you have to enter the function and arguments in cell C2. ... same as you do for any other Excel WS formula. ...
    (microsoft.public.excel.programming)
  • Re: What is a Sub
    ... If you want a Function then it's not a sub. ... Function Myfunction(Arg1, Arg2) As Double ... Functions in Excel are found in the function wizard, ... Then in Cell D1 I inserted all three ...
    (microsoft.public.excel.programming)

Loading