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: 6
Default Help! Overflow Error 6

oh oh...i rec'd this code from another valuable contributor and it worked
fine at first, however, the data changed, and now i get a OVERFLOW ERROR 6
when it gets to line 5 ?? the code fills down the numeric value, until it
reaches the next value, then takes THAT value, and fillsdown until the next
value, and so on, and so on...
-----------------------------------------------------------------------
debugging shows the following values for;
lngLastNum = 42010101
CLng(rngCell.Value) = 4201010101
-----------------------------------------------------------------------
Cell C1 (where it starts) has the following value: 4201
the next value encountered is: 42010101 - and it fills down correctly
next value encountered is: 4201010101 - that's when the b/o error occurs
------------------------------------------------------------------------
ACTUAL CODE
line
1 ' FILLDOWN TERRITORY NUMBERS
2 Dim rngCell As Range
3 Dim lngLastNum As Long

4 Set rngCell = Range("C1")
5 lngLastNum = CLng(rngCell.Value)

While Not IsEmpty(rngCell)
If IsNumeric(rngCell.Value) Then
lngLastNum = rngCell.Value
Else
rngCell.Value = lngLastNum
End If
Set rngCell = rngCell.Offset(1)
Wend
---------------------------------------------------------------
APPRECIATE YOUR ASSISTANCE - AS ALWAYS!
Sandi


 
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
Run-time error '6' overflow Suzy[_2_] Excel Programming 2 February 13th 04 04:55 PM
overflow error ExcelMonkey[_5_] Excel Programming 6 January 22nd 04 02:34 AM


All times are GMT +1. The time now is 03:26 AM.

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"