View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tim Williams[_2_] Tim Williams[_2_] is offline
external usenet poster
 
Posts: 298
Default Excel UDF implicit range argument

Named ranges are quite normal in Excel - plenty of info on the web and in
Help.
Eg:
http://www.contextures.com/xlNames01.html
http://www.exceltip.com/exceltips.ph...category&ID=24

What does the rest of your UDF look like ? - that might make a difference in
how it would work with named ranges as inputs...

Tim


"Teach1001" wrote in message
...
I have a UDF that works fine and have distributed it to students on an
add-in.
It is of the form fun(one as variant, two as variant) as variant
Now I find that some students do a very clever thing. They are working on
financial tables and name the rows with names like sales, cost, and
profit.
Then, to calculate profit they simply enter =sales - cost. Copy the
formula
to the right to the other columns and it looks the same, but it actually
grabs the right values of sales and cost in each column. I don't see this
documented, but type sales in any column and your will get the figure out
of
the sales row for that column.
My problem is that my UDF will not accept this kind of argument. The work
around is simply to write FUN( rate, 0+sales), forcing Excel to convert
the
sales reference to a specific number before calling the function.
Is there a way to avoid this work around? And, what is the name of this
strange referencing method my students are using?