LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Month -End Formula in VB

Function datEOM(datStartDate As Date, intNumMonths As Integer) As Date

Dim intIncrementYear As Integer
Dim intYear As Integer
Dim intMonth As Integer

intIncrementYear = Int((Month(datStartDate) + intNumMonths) / 12)
intYear = Year(datStartDate) + intIncrementYear
intMonth = Month(datStartDate) + intNumMonths + 1
If intMonth 12 Then intMonth = intMonth Mod 12

datEOM = DateSerial(intYear, intMonth, 1) - 1

End Function

--
Dianne

Hande & Tolga wrote:
We need to set the date of the month-end to a varaiable.
This function exists in excel EOMONTH but could not
achieve that in VB. We would like to know if there is
such a fuction or could be achieved with something else.



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
formula to calculate month-month User Excel Discussion (Misc queries) 2 February 16th 10 10:28 AM
Trying to get a Boolean formula to work month-to-month mstieler Excel Discussion (Misc queries) 4 July 18th 07 10:12 PM
Function or formula to convert "text" month to number of month? Steve Vincent Excel Discussion (Misc queries) 5 May 15th 07 01:11 AM
Function or formula to convert "text" month to number of month? Kevin Vaughn Excel Discussion (Misc queries) 0 February 4th 06 04:45 PM
Function or formula to convert "text" month to number of month Steve Vincent Excel Discussion (Misc queries) 1 February 4th 06 04:19 PM


All times are GMT +1. The time now is 02:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"