Solved

Calling VB function from cell in Excel 2010

Posted on 2011-09-12
2
394 Views
Last Modified: 2012-08-14
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
Comment
Question by:mikealsweiler
2 Comments
 
LVL 5

Assisted Solution

by:Didier Vally
Didier Vally earned 250 total points
ID: 36527452
0
 
LVL 41

Accepted Solution

by:
dlmille earned 250 total points
ID: 36527453
Paste the function in a public module, not ThisWorkbook module.

See attached.

Dave


isADate-r1.xlsm
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now