VBA Module in Excel
VBA Module in Excel
(OP)
I'm trying to create a custom function in Excel using a VBA module. My problem is that I can't get Pi to work. If I enter 3.14 my function works properly. If I use Pi I get an error. It seems to be using 0 for Pi.
For now, I'm using 3.14159265358979 for Pi, but I'd rather just use Pi. Can anyone help?
Thanks.
For now, I'm using 3.14159265358979 for Pi, but I'd rather just use Pi. Can anyone help?
Thanks.





RE: VBA Module in Excel
Example
Function test()
MsgBox (Excel.WorksheetFunction.Pi())
End Function
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: VBA Module in Excel
Thanks.
RE: VBA Module in Excel
Const PI as Double= 3.14159265358979
Then you can use it in Functions
A=PI*D*D/4
RE: VBA Module in Excel