View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.newusers
Niek Otten Niek Otten is offline
external usenet poster
 
Posts: 3,440
Default Excel fails to update call to user-written function.

Yes. The call to the UDF is always of the form

=MyFunc(A1,B1,C20:H40,15,"SomeText",TRUE,....)

So, arguments can be cell references, Ranges, text and numeric literals,
Booleans (and maybe I forget some).

In the definition of the function it is your choice to define the argument
types. The preciser you define them, the more Excel can validate (and
reject) them.
But no type definition, which means a Variant, gives more flexibility. For
example you could accept both text and numbers in a function which
determines the maximum.

Function MyFunc(Arg1, Arg2 as Double, Arg3 as Long, Arg4 as String, Arg5 as
Range,.......)

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Stefi" wrote in message
...
Sorry, I forgot to erase the out of date part. the real message is:

Hi Niek, I try to explain myself the method:
I have to include all the cell REFERENCES that are used in the function,
in
the
argument list of the call, but it is not necessary to declare arguments of
the UDF as Range.

e.g.
calling: =Myfunc(A1, B1, ....) A1, B1, .... are cell references
UDF:
Function MyFunc(Arg1, Arg2, ....) Arg1, Arg2, .... any type

Am I right?

Stefi