excel vba

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

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Excel VBA

Excel VBA

resolvedResolved · 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?

Edited on Thu 24 Jul 2008, 12:36

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 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.


 

Excel tip:

Using Alt in Save Dialog Box

When you are saving (or opening) a file, try these;
(Note the numbers are on the keyboard not the numeric keypad)
1. Go to previous folder Alt+1
2. Go up one folder level Alt+2
3. Search the Web Alt+3
4. Delete selected file Alt+4 or Delete
5. Create a new folder Alt+5
6. Cycle through all views Alt+6 repeatedly
7. Display the Tools menu Alt+7

View all Excel hints and tips


Server loaded in 0.08 secs.