LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Trap a DateValue Error

Excel 2003, WinXP Home
In VBA:
I want to validate the ActiveCell entry for a date.
I learned before that the IsDate function finds a valid date in just about
everything.
I learned to use the DateValue(ActiveCell) for this purpose.
But the only way I can see to trap the error is to use an On Error GoTo Err
trap and set the DateValue to something like:
a = DateValue(ActiveCell)
to force an error.
That works fine but it seems a round-about way to get there.
What I was hoping for was something like:
If IsError(DateValue(ActiveCell)) Then........
But this triggers a Type Mismatch.
How do I trap the error without the round-about method above?
Thanks for your help. Otto


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error.Type or IsError to trap #VALUE! and #NUM! Ms. AEB Excel Worksheet Functions 1 July 19th 07 06:51 PM
Cleaner Error trap in Loop. plys Excel Discussion (Misc queries) 3 January 20th 07 03:31 AM
Error trap with object variable problem Mike H[_7_] Excel Programming 1 February 6th 04 09:09 AM
error trap Rhonda[_3_] Excel Programming 2 October 22nd 03 07:07 PM


All times are GMT +1. The time now is 11:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"