View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default WorksheetFunction.EOMonth

A more direct approach, in my opinion...

Function eom(dteDate As Date) As Date
eom = DateSerial(Year(dteDate), Month(dteDate) + 1, 0)
End Function
--
Rick (MVP - Excel)


"Michael Kucan" wrote in message
...
Function eom(dteDate As Date) As Date
eom = (DateAdd("m", 1, dteDate - (Day(dteDate) - 1))) - 1
End Function

--
Thanks,

Michael Kucan


"Office_Novice" wrote:

Can this worksheet function be replicated in VBA? I would like to get the
end
of any given month, Any Thoughts?