Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
overflow error
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
overflow error
hi
overflow problem usuallly stem from misdeclared dims so I think the real problem is in your declarations. you may have the date set to integer. integer will only hold up to 32700??or so. today's serial data is 39905 which would produce an overflow ie to big of a number for so small of container. in vb help type "data types" for more info on this. regards FSt1 "Brad" wrote: 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
overflow error
Since this is a cell in a worksheet I didn't "Dim" anything.
"FSt1" wrote: hi overflow problem usuallly stem from misdeclared dims so I think the real problem is in your declarations. you may have the date set to integer. integer will only hold up to 32700??or so. today's serial data is 39905 which would produce an overflow ie to big of a number for so small of container. in vb help type "data types" for more info on this. regards FSt1 "Brad" wrote: 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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
overflow error
hi
post all of your code. Regards FSt1 "Brad" wrote: Since this is a cell in a worksheet I didn't "Dim" anything. "FSt1" wrote: hi overflow problem usuallly stem from misdeclared dims so I think the real problem is in your declarations. you may have the date set to integer. integer will only hold up to 32700??or so. today's serial data is 39905 which would produce an overflow ie to big of a number for so small of container. in vb help type "data types" for more info on this. regards FSt1 "Brad" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Overflow error.. why? | Excel Discussion (Misc queries) | |||
Overflow error | Excel Programming | |||
Overflow Error | Excel Discussion (Misc queries) | |||
Overflow Error | Excel Programming | |||
Help! Overflow Error 6 | Excel Programming |