private function Factorial (byval Num as integer) as long
dim i as integer
Factorial = 1
for i = 2 to Num
Factorial = Factorial * i
next i
end function
private sub Factorial (byval Num as integer, byref lngRet as long)
dim i as integer
lngRet = 1
for i = 2 to Num
lngRet= lngRet* i
next i
end sub