Results 1 to 50 of 50

Store Array created by VBA macro “Internally” for use in same VBA macro by next run..or..-

Threaded View

  1. #1
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Store Array created by VBA macro “Internally” for use in same VBA macro by next run..or..-

    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.
    Last edited by Doc.AElstein; 08-09-2015 at 08:43 AM.
    '_- Google first, like this _ site:ExcelForum.com Gamut
    Use Code Tags: Highlight code; click on the # icon above,
    Post screenshots COPYABLE to a Spredsheet; NOT IMAGES PLEASE
    http://www.excelforum.com/the-water-...ml#post4109080
    https://app.box.com/s/gjpa8mk8ko4vkwcke3ig2w8z2wkfvrtv
    http://excelmatters.com/excel-forums/ ( Scrolll down to bottom )

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Dynamic Changing Data, Based on Criteria Store in Array, Sum array and store in Cell
    By penbeacho in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-28-2015, 10:31 AM
  2. Add file to the Record Macro Store macro in drop down
    By dalfiuss in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-27-2015, 11:26 AM
  3. Replies: 3
    Last Post: 03-21-2014, 01:19 PM
  4. [SOLVED] Write and assign macro to newly created button using macro
    By tryingtolearn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-19-2012, 10:41 PM
  5. Perform macro "on open" specific file- store macro in Personal Macro Workbook?
    By thompssc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2012, 12:38 PM
  6. macro to store each ine of a text file in an array
    By mithil in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2010, 01:41 AM
  7. Array limit for a macro created chart
    By sanraso in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 06-16-2008, 02:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1