Short question on Datedif

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
 
B

Basta1980

Per,

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

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

Regards
 
J

Jacob Skaria

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

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

If this post helps click Yes
 

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

Top