Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default units = ActiveCell.Value overflow

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?

Reply
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
Units Produced / (finish time minus start time)=Units Per Hr Gary A Excel Worksheet Functions 1 February 10th 09 01:35 AM
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
Overflow Erik Beck Jensen Excel Programming 2 December 13th 05 10:11 AM
VBA overflow Tom Ogilvy Excel Programming 3 September 2nd 03 09:04 PM
VBA overflow Don Guillett[_4_] Excel Programming 2 September 2nd 03 04:19 PM


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