Thread: Error Handling
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chris Chris is offline
external usenet poster
 
Posts: 788
Default Error Handling

Use the IsDate function:
If IsDate(TheDate) Then
"Do something"
End If


"bw" wrote:

Me![Calendar1].Value = CDate(TheDate)

If "TheDate" is not a valid date, i.e. 00/00/04, how do I keep this code from giving me an
error? Or can I perform some check on "TheDate" to make sure it's "legal" before this
code?

Thanks,
Bernie