
- VBA Tutorial
- VBA - Home
- VBA - Overview
- VBA - Excel Macros
- VBA - Excel Terms
- VBA - Macro Comments
- VBA - Message Box
- VBA - Input Box
- VBA - Variables
- VBA - Constants
- VBA - Operators
- VBA - Decisions
- VBA - Loops
- VBA - Strings
- VBA - Date and Time
- VBA - Arrays
- VBA - Functions
- VBA - Sub Procedure
- VBA - Events
- VBA - Error Handling
- VBA - Excel Objects
- VBA - Text Files
- VBA - Programming Charts
- VBA - Userforms
- VBA Useful Resources
- VBA - Quick Guide
- VBA - Useful Resources
- VBA - Discussion
VBA - IsDate Function
A Function, which returns a Boolean value whether or not the given input is a date.
Syntax
IsDate(expression)
Example
Add a button and add the following function.
Private Sub Constant_demo_Click() msgbox("Line 1 : " & IsDate("Nov 03, 1950")) msgbox("Line 2 : " & IsDate(#01/31/20#)) msgbox("Line 3 : " & IsDate(#05/31/20 10:30 PM#)) End Sub
When you execute the above function, it produces the following output.
Line 1 : True Line 2 : True Line 3 : True
vba_date_time.htm
Advertisements