Anyone use VBA in Excel: eclaring Arrays as Public

  • Thread starter Thread starter Saladsamurai
  • Start date Start date
  • Tags Tags
    Arrays Excel
Click For Summary
The discussion centers around the use of VBA in Excel, specifically regarding the declaration of arrays as Public. A user encountered an issue with their code, which was not functioning as expected. After investigation, it was discovered that the problem stemmed from writing the code in a sheet instead of a module. This highlights the importance of understanding the correct context for declaring Public arrays in VBA to avoid common errors.
Saladsamurai
Messages
3,009
Reaction score
7
Anyone use VBA in Excel::Declaring Arrays as Public

Egads man...I have seen plenty of modules with arrays declared as Public. Clearly I am making some boneheaded error here and cannot locate it:

ExcelError.jpg


Any Thoughts?
 
Technology news on Phys.org


Solved:

After some searching I found that the error is because I wrote my code in a sheet and not a module... :/
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 3 ·
Replies
3
Views
8K
Replies
8
Views
2K
  • · Replies 23 ·
Replies
23
Views
2K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 12 ·
Replies
12
Views
2K
Replies
235
Views
14K
  • · Replies 31 ·
2
Replies
31
Views
3K
Replies
6
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K