Hi,
I was hoping someone might be able to explain this to me. When I execute the following code (which simply calculates a value, and using debug.print, outputs the result), I get a Run-time Error '6' Overflow message.
Sub calc_ulation()
Dim x As Long
x = 1000 * 60
Debug.Print x
End Sub
However, if I replace the 1000 with either (10^3) or 1000.0 (which is abbreviated to 1000#) I get no error message and the code executes with the output being displayed in the Immediate window. I'm a bit confused by this; 60000 is within the range of a Long variable type.
Any help / explanation would be much appreciated.
Kind regards, 2016LM
I was hoping someone might be able to explain this to me. When I execute the following code (which simply calculates a value, and using debug.print, outputs the result), I get a Run-time Error '6' Overflow message.
Sub calc_ulation()
Dim x As Long
x = 1000 * 60
Debug.Print x
End Sub
However, if I replace the 1000 with either (10^3) or 1000.0 (which is abbreviated to 1000#) I get no error message and the code executes with the output being displayed in the Immediate window. I'm a bit confused by this; 60000 is within the range of a Long variable type.
Any help / explanation would be much appreciated.
Kind regards, 2016LM