Short question on Datedif

  • Thread starter Thread starter Basta1980
  • Start date Start date
B

Basta1980

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
 
Per,

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

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

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

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

If this post helps click Yes
 
Back
Top