View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default How I can create a function with return argument

Generally a function has the following form...

public function numoffday() as long
numoffday = 12345
end function

I used a long instead of an integer as it is actually more efficient to use
a long on a 32 bit machine...
--
HTH...

Jim Thomlinson


"pol" wrote:

I have a macro program numoffday

Sub offdays()
li_sunday = .Cells(i, 41).Value
int offDays = numoffday(li_sunday)
End Sub

Please let me know how I can create a function numoffday() with integer
return value in Excel macros