ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calling a Public Function (https://www.excelbanter.com/excel-programming/398316-calling-public-function.html)

David

Calling a Public Function
 
I'm probably doing something really stupid here, I've got a Public
Function:

Public Function Repayment_Calculator(iRepayment, iTerm)

But when I try to call it from another module like this:

cur_0Tap = Repayment_Calculator(0, int_term)

I get this error:

Sub or function not defined.

So, what did I do wrong this time?

Thanks as usual!

David


Jim Cone

Calling a Public Function
 
David,
Your public function should be in a standard module.
Functions are private if they are in ThisWorkbook module or in a
module behind a sheet.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"David"
wrote in message
I'm probably doing something really stupid here, I've got a Public
Function:

Public Function Repayment_Calculator(iRepayment, iTerm)
But when I try to call it from another module like this:

cur_0Tap = Repayment_Calculator(0, int_term)

I get this error:
Sub or function not defined.
So, what did I do wrong this time?
Thanks as usual!
David



All times are GMT +1. The time now is 11:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com