Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have been wracking my brains on what happens when we declare a variable, in spite of what programming literature says. The code below declares X as integer and should accordingly handle all values within the bounds -32763 to + 32673. But the code generates an overflow error after p=30,000 and when x =3. Sub Declaratn2() Dim x As Integer Dim p As Long For x = 1 To 1000 p = x * 10000 MsgBox p Next End Sub Is it correct to say that EXCEL is evaluating x against the product x*1000? I am confused. David. -- davidm ------------------------------------------------------------------------ davidm's Profile: http://www.excelforum.com/member.php...o&userid=20645 View this thread: http://www.excelforum.com/showthread...hreadid=484197 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA - variable declaration | Excel Discussion (Misc queries) | |||
External Variable Declaration | Excel Programming | |||
External Variable Declaration | Excel Programming | |||
Global variable declaration! | Excel Programming | |||
Variable Declaration?? | Excel Programming |