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

Scott has attended:
Excel VBA Intro Intermediate course

Excel

how do you declare a public variable

RE: excel

Hi Scott

A public variable is a variable that can be accessed by all the sections of code in a project.

One example of the use of a Public variable is data being entered on a form that needs to be moved to a module.

As a good coding practice you should declare the public variable in the Option Explicit area of the code page

To declare a Public variable you use the following code

Public MyVariable As String

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:

Quickly hide and unhide rows and columns

Use the keyboard shortcut Ctrl+9 to hide selected rows and Ctrl+0 to hide selected columns. The good thing about this shortcut is that you do not need to select entire rows or columns. For example, select B3:D3 then press Ctrl+0 to hide columns B to D.

Ctrl+Shift+9 unhides rows and Ctrl+Shift+0 unhides columns.

View all Excel hints and tips


Server loaded in 0.08 secs.