How I can create a function with return argument

  • Thread starter Thread starter pol
  • Start date Start date
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
 
Please tell us in words what you need the function to do
best wishes
 
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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top