vba courses london - overflow error long integer

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft VBA Training and help » vba courses london - Overflow error for long integer

vba courses london - Overflow error for long integer

resolvedResolved · Low Priority · Version Standard

Femi has attended:
Excel Intermediate course
Excel Advanced course
Excel VBA Intro Intermediate course

Overflow error for long integer

The MS VB help file has an example of an overflow error, i.e.

dim x as long
x = 2000 * 365

Why does this produce an overflow error when x would be 730,000, which seems to be within the range of
-2,147,483,648 and 2,147,483,647?

RE: Overflow error for long integer

Hi Femi

I have looked at this and even searched the net and I think there is an error on the example.

The dim should have read:

Dim X as Integer

All the examples I found used Integer, and the Help file example works perfectly using it.

Carlos

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

VBA tip:

Stop Display Alerts In Excel

When creating or deleting a Worksheet in Excel you don't want Excel to inform you "A file already exists....." Or "Do you want to save this file...".

To stop these alerts happening use the following line of code:

Application.DisplayAlerts = False

After the Create or Delete routine use:

Application.DisplayAlerts = True

View all VBA hints and tips


Server loaded in 0.08 secs.