Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

edate & eomonth

Status
Not open for further replies.

ChrisParks

Technical User
Feb 27, 2007
10
US
these are excel functions that i use a lot
im wondering if vba holds them a spot
id like to use them, but not sure if i may
does excel vba have an alternative way?
 
edate & eomonth are excel functions
Really ?
What are they supposed to do ?
 



Hi,

No, but you can, in many cases, use worksheet functions in VBA, by using the Application object
Code:
n = application.Sum([MyRange])

Skip,

[glasses] [red][/red]
[tongue]
 
edate allows you to increment a date by months ie...
edate(2/15/2006,1) returns 3/15/2006

eomonth returns the last day of the month of a given date

oh well, guess not
thanks
 
Have a look at the DateAdd and DateSerial functions (typed, untested):
Function edate(dtStart As Date, intMonth As Integer) As Date
edate = DateAdd("m", intMonth, dtStart)
End Function

Function eomonth(dtStart As Date) As Date
eomonth = DateSerial(Year(dtStart), 1 + Month(dtStart), 0)
End Function

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Edate and eomonth are Analysis Toolpak add-in functions. Just install 'Analysis Toolpak - VBA' in excel and reference 'atpvbaen.xls' in excel VBE. Its functions will be then available for vba.

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top