excel

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

Excel

resolvedResolved · Low Priority · Version 2003

Wilhelm has attended:
Excel VBA Intro Intermediate course
Excel VBA Intro Intermediate course

Excel

What are the difference between Global,Public and Private

RE: Excel

Hi Wilhelm

In Excel when declaring variables, Public is used to declare all Global variables (variables that are used at project/workbook level). They are usually declared at the top of a Module just under Option Explicit. eg

Public MyName As String

A Private variable can only be seen in the area that it has been declared in. This is used instead of the normal Dim to further emphasize that the declared variable must not be accesed from outside the declaration area. eg

Private MyAge As Byte

Hope this helps

Carlos

Fri 28 Nov 2008: Automatically marked as resolved.

 

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:

The dual nature of toolbar buttons

Many toolbar buttons are dual purpose, though the two purposes are often linked in some way. For example, Align Left aligns a cell's contents to the left of the cell. However, hold down Shift and press the Align Left button: Excel aligns the cell contents to the right.
You may respond: So what? Well, you can reduce the number of buttons on your toolbar to make your screen less cluttered and allow more room for, perhaps, some of your own commands. After all, what's the point of an Align Right button when Shift+Align Left does the same thing?

View all Excel hints and tips


Server loaded in 0.08 secs.