Using functions

  • Thread starter Thread starter pcor
  • Start date Start date
P

pcor

I would like to use a home made FUNCTION to divide two numbers
So far In a module I have placed the following code:
Function cutit(a%,b%)
cutit=a%/b%
end function
In the spread sheet I call the function:
=cutit(12,6)

I them get the error message NAMe$
what am I doing wrong
 
I would like to use a home made FUNCTION to divide two numbers
So far In a module I have placed the following code:
Function cutit(a%,b%)
cutit=a%/b%
end function
In the spread sheet I call the function:
=cutit(12,6)

I them get the error message NAMe$
what am I doing wrong

Although you could just use =12/6 I suspect that if you take your
function out of the SHEET module and place in a REGULAR module, it
will work....
 
Your UDF works for me as is when function is in same workbook.

=cutit(12,6) returns 2

Where do you have it stored?

A module in the workbook or a module in an external workbook like Personal.xls?

=Personal.xls!cutit(12,6) would be OK


Gord Dibben MS Excel MVP
 
Back
Top