View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Short question on Datedif

In VBA the function is DATEDIFF() and not DATEDIF()

MsgBox DateDiff("yyyy", Range("A1"), Range("B1"))

If this post helps click Yes
---------------
Jacob Skaria


"Basta1980" wrote:

Per,

I'm sorry, still early morning here in the Netherlands;

MsgBox = datedif(a1, b1, "y")

Regards

"Per Jessen" wrote:

Hi

You forgot to post the code.

Regards,
Per

"Basta1980" skrev i meddelelsen
...
Hi,

See code below. When I run macro I get 'compile error: Sub or Function not
defined'. What am I doing wrong here?!

Regards,

Basta1980