Tom, okay i was blunt:)
my point was..
a cell may hold a large floating point value.
even when assigned to a long variable it can overload.
(infamous example: ?cells.count in excel 2007)
Tip for OP:
an integer holds -32768 to +32768 only.
a long holds from -2 to +2 billion.
IN VBA just dont just Integer but Long for al your counters.
the extra bytes dont matter as much as they did in 1980.
--
keepITcool
|
www.XLsupport.com | keepITcool chello nl | amsterdam
Tom Ogilvy wrote in
You can easily overload a double...
Sub OverflowDouble()
Dim d#
d = CDbl(1E+308) * 2#
End Sub
is that helpful?