Thread: overflow error
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Brad Brad is offline
external usenet poster
 
Posts: 846
Default overflow error

One solution - are there better solutions

On Error GoTo ErrCorrect
..
..
..

ErrCorrect:
If Target.Address = Range("cdate").Address Then
MsgBox ("Please use slashes (/) when entering dates")
If Left(Range("prod1").Value, 3) = "LBD" Then
Range("cdate").Value = DateSerial(2007, 1, 1)
Else
Range("cdate").Value = DateSerial(1984, 12, 1)
End If
End If





"Brad" wrote:


Using Excel 2007 - with compatibilty witn 2003.

Trying to find problems with my VBA code

I have a cell that is set up to accept dates (range named "cdate"). If an
individaul enter 04012009 in that cell, I get an "overfloww" error.

What options do I have to capture this event?

The VBA code breaks at the following line.
If Range("cdate").Value = "" Then