Store Array created by VBA macro “Internally” for use in same VBA macro by next run... or............
... or........more fully.....
Store Array and values in variables created by VBA macro “Internally” for use in same VBA macro by next run, or by other VBA macros, after the macro creating the Array or Variables has stopped.
. I expect the answer to this may be
. a ) No
. b ) why bother – simply export the Array contents or variable values to an excel sheet and reference them from there!
. But: I was hoping it may be possible and give speed advantages....
... (... The basic requirement came from a code I am developing here:
http://www.excelforum.com/excel-prog...user-form.html
. In this code a Worksheets_Change Sub routine accesses a very large spreadsheet range, and creates various large Arrays from which totals calculations are made based on an entry in column C in the spreadsheet.... )
.
.
. So I was wondering if it is possible to create some of those Arrays for example in another Sub routine, such as a in a Worksheets Open Code, and have those already available to the Worksheets Change Sub routine immediately when it runs.
. I was expecting if this could be done it would have speed advantages as:
. a ) I have learnt from my Forum participation the advantages of minimising the interaction with the spreadsheet.
. b) Not all the calculations and Array making need to be done every time, so if the “internal accessing” of these “internally stored” Arrays worked quickly then this would be quicker than re-doing the calculations to produce them.
Does Anyone
. (i) Know if this is Possible
And if it is possible
. ( ii ) Can anyone get me started on how
. Note:
. I am primarily interested in storing .value2 numbers up to the accuracy level of about 7 decimal places in “normal” format, for example 345.0965401, to a maximum of about 9999.00 and a minimum of about 0.0000001
. This is a long term personal project for me, so speed is not of essence. If anyone comes up with an idea in the future please post here.
. Thanks
Alan.
P.s. I do have some experience with the Microsoft Scripting Runtime Directory, but I believe, as its name suggest, that Dictionary “vanishes” when the program stops )
P.p.s. My knowledge generally of computing is restricted to a couple of years with Excel VBA. If there is a method to achieve what I want, could someone further help me by
. a) give for example the VBA code lines that would export some Array, say arr1(), to the “internal storage”
And
. b ) give the code lines that would retrieve this Array.
. c ) give me any other code lines needed, such as the accessing of any external Libraries necessary.
Bookmarks