option explicit possible problem
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Option Explicit possible problem

Option Explicit possible problem

resolvedResolved · Low Priority · Version 2003

replyReply Fri 28 Jan 2011, 17:00Delegate Robert said...

Robert has attended:
Excel VBA Intro Intermediate course

Option Explicit possible problem

When writing code in today's course Option Explicit even though on did not seem to stop non existent variables being used.

Is this a problem of the machines used or is it a wider problem.

For upcoming training course dates see: Pricing & availability

replyReply Tue 1 Feb 2011, 14:03Trainer Anthony said...

RE: Option Explicit possible problem

Hi Bob, thanks for your query. We are still investigating this and believe it to be a consequence of running two versions of Excel on the same machine. Some misspelt variables appear to be declared as variants when they should be trapped by Option Explicit. We believe this to be a problem for us on our training machines rather than an application error but if you spot it happening elsewhere let us know on the forum.

All the best,

Anthony

Tue 8 Feb 2011: Automatically marked as resolved.

 

Please browse our web site to find out more about
excel computer training and other Microsoft training courses.

Excel tip:

Generating Random Numbers

To generate a random number in Excel use the = RAND() function.

The value returned will always be between 0 and 1. To convert this to some other random value, you will need to multiply the result by the highest number you want to consider. For example, if you wanted a random number between 1 and 25, you could use the following code line:
= INT(25 * RAND()+ 1)

Since RAND() will always returns a value between 0 and 1 (but never 1 itself), multiplying what it returns by 25 and then using the Integer function INT on that result will return a whole number between 0 and 24.

Finally, 1 is added to this result, so that x will be equal to a number between 1 and 25, inclusive

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard