Good afternoon Liosan
No, nothing like that. The code you provided returned 42 (the secret
of the Universe, apparently) without problem. Where are you placing
the code? If it is placed in a blank module within the VBE (Insert
Module) the formula =Foo() should work fine. Try it again and if you
still have a problem post back and I'll upload a spreadsheet containing
your code.
HTH
DominicB
--
dominicb
------------------------------------------------------------------------
dominicb's Profile:
http://www.excelforum.com/member.php...o&userid=18932
View this thread:
http://www.excelforum.com/showthread...hreadid=395765