ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Variable life (https://www.excelbanter.com/excel-programming/284348-variable-life.html)

morph

Variable life
 
Hello. Please help me if you can.

If you "Dim" an array at module level, the contents of the
array survive after the code stops running.

For example, I can load up an array with one button click.
After that program stops, I can then change sheets (or
whatever) and click another button and do something with
the contents of that array in a completely separate
subroutine.

Is there a way to do this with a single element variable?
If so, could you supply me with the example code to do it?

Thanks in advance for your assistance.





Jim Rech

Variable life
 
Non-array variables are exactly the same, if declared at the module level.

--
Jim Rech
Excel MVP




All times are GMT +1. The time now is 02:58 PM.

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