How I can create a function with return argument

P

pol

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
 
J

Jim Thomlinson

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...
 
Top