Article ID: 103184
Article Last Modified on 1/18/2007
'******************************************************
'Declarations Section of Module
'******************************************************
Option Explicit
'******************************************************
'FindEOM Function
'******************************************************
'This function takes a date as an argument and returns the last
'day of the month.
Function FindEOM (MyDate)
Dim NextMonth, EndOfMonth
NextMonth = DateAdd("m", 1, MyDate)
EndOfMonth = NextMonth - DatePart("d", NextMonth)
FindEOM = EndOfMonth
End Function
Use the following sample expression to call the FindEOM() function:
=FindEOM(#5/5/94#)To view the results of the FindEOM() function, type the following line in the module's Debug window (or Immediate window in versions 1.x and 2.0), and the press ENTER:
?FindEOM(#5/5/94#)
Keywords: kbinfo kbprogramming KB103184