98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Excel VBA
Excel VBA
Resolved · Low Priority · Version 2003
Guangwen has attended:
Excel Advanced course
Excel VBA Intro Intermediate course
Excel VBA
How many different ways can variables be defined?
Variable Scope
Hi Guangwen
When declaring variables it must be remembered that there are 3 levels. They are:
Procedure-Level Variables
This is the most widely used variables. They are declared inside the Procedure itself (using the Dim keyword). Only the procedure that contains the variable declaration can use it. As soon as the Procedure finishes, the variable is destroyed.
Module-Level Variables
These are variables that are declared outside the Procedure itself in the Declarations section of a module (using the Dim keyword).
All variables declared at this level are available to all Procedures within the Module.
Public Variables
These variables are declared at the top of any standard Public module. Public variables are available to all procedures in all modules in a project
The Public keyword can only be used in the Declarations section
Hope this helps
Carlos
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
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Using Alt in Save Dialog BoxWhen you are saving (or opening) a file, try these; |