View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
wienmichael wienmichael is offline
external usenet poster
 
Posts: 11
Default Loop w/ Public Function as arguement

I am trying to create a loop to count how many times a date function I have
written is performed before a criteria is met. I am receiving a ByRef error,
and do no know how to fix it. Here is the code:

Public Function myfunc(testdate, maturitydate)
counter = 0
Do While maturitydate testdate
testdate = nextcdate(testdate)
counter = counter + 1
Loop
myfunc = counter
End Function

Thanks