ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Use spreadsheet cells for global variable space? (https://www.excelbanter.com/excel-programming/436860-use-spreadsheet-cells-global-variable-space.html)

Robert Crandal

Use spreadsheet cells for global variable space?
 
I have two large arrays of integers that I would like to initialize
when my workbook is opened. Since it seems too difficult
(and maybe impossible) to make these arrays global to ALL
of my VBA code modules, I thought of the following solution:

How about I create one hidden sheet in my workbook and
use the cells to simulate an array of data? If my data is stored
in a hidden sheet, that sheet could be easily accessed by ANY
of my VBA modules.

Any comments or suggestions???



OssieMac

Use spreadsheet cells for global variable space?
 
Hi Robert,

I have always found it to be a very successful method. You can also set up
your system so that Administrators with the correct password can make
modofications. However, consider very hidden code so that the worksheet
cannot be unhidden in the user interface mode.

Example hiding.
Sheets("Sheet2").Visible = xlVeryHidden

Can only unhide with code as follows.
Sheets("Sheet2").Visible = True

--
Regards,

OssieMac


"Robert Crandal" wrote:

I have two large arrays of integers that I would like to initialize
when my workbook is opened. Since it seems too difficult
(and maybe impossible) to make these arrays global to ALL
of my VBA code modules, I thought of the following solution:

How about I create one hidden sheet in my workbook and
use the cells to simulate an array of data? If my data is stored
in a hidden sheet, that sheet could be easily accessed by ANY
of my VBA modules.

Any comments or suggestions???


.



All times are GMT +1. The time now is 11:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com