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: 28
Default Runtime Error 6 Overflow

I have the following code.. It's producing a Runtime error 6 overflow.
I can't get it to produce it every time but generally it will fail when
entering about 10 values in the F:12 or cells. Also sometimes after
selecting a cell and hitting hte delete key it will force it to 0.00
and will stay that way until a new value is entered. Any ideas?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim i As Integer
Dim d As Double

Application.EnableEvents = False
With Target(1)

' Make sure Debits are postive values
If Not Intersect(.Cells, Range("F12",
Range("F12").End(xlDown))) Is Nothing Then
If IsNumeric(.Value) = True Then
.Value = Abs(.Value)
i = CInt(CDbl(.Value) * 100) ' This line is where the
error is reported from
d = CDbl(.Value) * 100
If Abs(d - i) 0 Then
MsgBox "Rounding error detected! Make sure you
don't have numbers with values less than 1/100th", vbExclamation
End If
Else
.Value = ""
End If
End If
End With
Application.EnableEvents = True
End Sub

 
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
Overflow error.. why? Fingerjob Excel Discussion (Misc queries) 4 November 13th 06 05:18 PM
runtime error '6' overflow don Setting up and Configuration of Excel 1 July 26th 05 02:52 AM
Overflow Error DG Excel Discussion (Misc queries) 3 April 15th 05 05:45 PM
Help! Overflow Error 6 Gauthier Excel Programming 6 September 24th 04 12:57 PM
overflow error ExcelMonkey[_5_] Excel Programming 6 January 22nd 04 02:34 AM


All times are GMT +1. The time now is 06: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"