Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 416
  • Last Modified:

Calling VB function from cell in Excel 2010

I have a function that I have pasted into the "This Workbook" module in the VBA Project for my Excel 2010 workbook.


Public Function IsADate(cel) As Boolean
    IsADate = IsDate(cel)
End Function


I was expecting that in a cell in the spreadsheet that I could now type =IsADate(C3). But when I do Excel does not recognise the function and I get a #NAME? error.

I'm sure this used to work on older versions of Excel (but could be wrong!)

I've Excel I've enabled all macros and ticked trusted access to the VBA Project object model...

What am I doing wrong? Thanks in advance.
0
mikealsweiler
Asked:
mikealsweiler
2 Solutions
 
Didier VallySystems Engineer and Finance AnalystCommented:
0
 
dlmilleCommented:
Paste the function in a public module, not ThisWorkbook module.

See attached.

Dave


isADate-r1.xlsm
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now