XL98: Public Variables Not Seen on Modules for Sheet or UserForm (188441)
The information in this article applies to:
- Microsoft Excel 98 Macintosh Edition
This article was previously published under Q188441 SUMMARY
If you declare a public variable in a Visual Basic for Applications module
that is associated with an object, such as a UserForm or a Worksheet
object, only the procedures in the module can access the value of the
variable.
If you declare a variable with the Public statement in a module that is
associated with an object, such as a UserForm and Worksheet object, the
variable is only available in that module.
If you want to access a public variable in all procedures for all modules
of a project, you must declare the variable in a general module. To insert
a general module in a project, click Module on the Insert menu.
REFERENCES
For more information about the scope of variables, click the Office
Assistant, type scope click Search, and then click to view
"Understanding Scope and Visibility."
NOTE: If the Assistant is hidden, click the Office Assistant button on the
Standard toolbar. If Microsoft Help is not installed on your computer,
please see the following article in the Microsoft Knowledge Base:
179216 OFF98: How to Use the Microsoft Office Installer Program
Modification Type: | Major | Last Reviewed: | 6/17/2005 |
---|
Keywords: | kbhowto kbProgramming KB188441 |
---|
|