PDA

View Full Version : trouble with modestly large integers



PhilJette
01-22-2013, 11:16 AM
Hi guys,

I'm running a script to produce a particular integer sequence within a given range. Unfortunately I've hit a bit of a wall using the long datatype, despite the fact that so far i'm only around 10-12 digits.

Basically VBA is adding a hashtag immediately after the number, then causing an overflow error (see image). Any idea what this might be?

Thanks!

p45cal
01-22-2013, 05:30 PM
Long data type
A 4-byte integer ranging in value from -2,147,483,648 to 2,147,483,647.

So you won't be able to assign 2147483660 to a Long variable.

Use Double?