edate function in VBA

  • Thread starter Thread starter fdiez67
  • Start date Start date
F

fdiez67

Is it possible to use edate function in VBA? I tried
WorksheetFunction.edate = ... and that doesn't work. TIA.
 
Is it possible to use edate function in VBA? I tried
WorksheetFunction.edate = ... and that doesn't work. TIA.

That particular worksheet function is not accessible in
VBA. You can find out which ones are accessible by
using the Object Browser.

Merjet
 
Try something like

MsgBox Format(Application.Evaluate("edate(A16, 5)"), "dd mmm yyyy")


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
The EDate function is part of the Analysis Tool Pak add-in. To use it in
VBA, you need to first load the "Analysis Tool Pak - VBA" add-in in Excel.
Then, open your VBA project, go to the Tools menu, choose Reference, and put
a check next to ATBVBAEN.xls item. Once you do this, you can access the
function directly. E.g.,

Dim Res
Res = edate(Now, 3)
Debug.Print Res


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

An alternative for the edate function... 4
VBA functions 2
EDate function? 1
Function EDATE () 1
Changing Dates 3
How do I round a date? 3
EDATE & #NA Errors 5
Please Help in this Compound Interest UDF 2

Back
Top