Function written in VBA not recognized

T

Thrava

Hi folks,
I wrote a simple Function in VBA that I know it works when
I test it in VBA, which I named LogRatio which takes two
paramerters.... LogRatio(a,b)
But when I use this function in the application, in one of
the cells.. such as =LogRatio(3,5)

I get an error message of #Name?

Any idea why the function, though its Public, is not
recognized in the same sheet that I wrote the VBA code?

Thanks
 
A

Arvi Laanemets

Hi

Are you sure you did write an function - maybe it was a procedure.
Maybe post your code here - it's impossible to decide what is wrong without.
 
N

Niek Otten

Write the function in a General Module, not a Sheet Module

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel
 
B

Bob Phillips

and not ThisWorkbook.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
T

Thrava

Thank you all for responding,
Yes, I've placed the code in General module and now it is
recognized.
Thank you again
Trava
 
Top