Basic rules of VBA programming in Excel

This forum is for comments and feedback on the articles published in the main part of the website.

Basic rules of VBA programming in Excel

Postby Admin » 24 Dec 2009, 20:57

Please reply to this post with any comments on the article Basic rules of VBA programming in Excel.
Admin
Site Admin
 
Posts: 3
Joined: 18 Oct 2009, 11:39

Re: Basic rules of VBA programming in Excel

Postby Robert » 25 Sep 2010, 19:00

5.Always use Option Explicit
Why? First, if you do not use Option Explicit and misspell a variable, VBA will treat it as a new variable having a value of zero and won't through an error. And this error will be hard to find! Second, Option Explicit encourages you to think of proper types for variables, rather than just using Variant, which is often inefficient.


I think that you mean throw instead of through. This should be an easy fix.
Robert
 
Posts: 1
Joined: 25 Sep 2010, 18:52

Re: Basic rules of VBA programming in Excel

Postby Support » 26 Sep 2010, 18:29

Yes, indeed! Thanks! And it also shows why Option Explicit is important: it's easy to misspell things! ;)
Support
 
Posts: 41
Joined: 18 Oct 2009, 15:22


Return to Comments on articles

Who is online

Users browsing this forum: No registered users and 1 guest

cron