Hi,
I have created a simple UDF in VBA and the same formula on my spreadsheet. The values created by both ways are quite different, and I cannot figure out why there is such a large discrepancy.
In VBA I am using many VBA functions such as Log, Exp and then some Excel functions such as WorksheetFunction.Pi, WorksheetFunction.NormSDist(x) for example.
Firstly, why do you think the results are so different? I am talking errors in the range of 50% of the answer to 150% of the answer.
Secondly, is there a way to troubleshoot a UDF in VBA the same way as a procedure? The help menu is useless in VBA. Can I see the values for certain inputs in my code, similar to using the break point and run method for sub routines?
Any help is much appreciated.
James
I have created a simple UDF in VBA and the same formula on my spreadsheet. The values created by both ways are quite different, and I cannot figure out why there is such a large discrepancy.
In VBA I am using many VBA functions such as Log, Exp and then some Excel functions such as WorksheetFunction.Pi, WorksheetFunction.NormSDist(x) for example.
Firstly, why do you think the results are so different? I am talking errors in the range of 50% of the answer to 150% of the answer.
Secondly, is there a way to troubleshoot a UDF in VBA the same way as a procedure? The help menu is useless in VBA. Can I see the values for certain inputs in my code, similar to using the break point and run method for sub routines?
Any help is much appreciated.
James