Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Calling VB function from cell in Excel 2010

Posted on 2011-09-12
2
Medium Priority
?
412 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 1000 total points
ID: 36527452
0
 
LVL 42

Accepted Solution

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

See attached.

Dave


isADate-r1.xlsm
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

810 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