+ Reply to Thread
Results 1 to 9 of 9

Storing values in dynamic array

  1. #1
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Storing values in dynamic array

    This is a holistic type question.
    If I had a dynamic array of string variables, can these be stored within Visual Basic Editor? Rather than a hidden worksheet or text file.

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,070

    Re: Storing values in dynamic array

    If the array needs to be dynamic, where would it get the values to begin with?

  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Storing values in dynamic array

    Not sure what you mean by dynamic... but you can store in VBE like.

    Please Login or Register  to view this content.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  4. #4
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Storing values in dynamic array

    If the array needs to be dynamic, where would it get the values to begin with?
    It's hard to explain as I don't know how to do it yet, but it will be a list of words which are passed through a spell checker and if passed, the spell check will not query it next time. The words are stored in a dynamic array.
    For example, if I check strings such as "e = mc^2", initially it will be queried by a spell checker. If I then have an event which approves the sting, it will not be queried the next time a spell check is run.

  5. #5
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Storing values in dynamic array

    Not sure what you mean by dynamic... but you can store in VBE like.
    I was looking to input via Excel, not writing to Visual Basic Editor.

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Storing values in dynamic array

    It's technically possible. But since any variable/object is destroyed by garbage collector when it goes out of context...

    It will depend on the scope of variable.

    If you store in public variable. This can be accessed as long as workbook is open (once closed, it will be destroyed).

    To have access to it across instance, you'd need to store it in somewhere else (Ex: worksheet, external file such as txt, registry etc)

    Edit: To expand on technically possible part. You can write another module to update module where you want to store something. But this is convoluted process and there are several issues/dangers associated with this. Simply storing it in worksheet is much easier to control and maintain (or in external location).
    Last edited by CK76; 09-18-2019 at 10:34 AM.

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,070

    Re: Storing values in dynamic array

    Assuming that you are using a custom built checker of some sort, then you would have to store those strings somewhere.

  8. #8
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Storing values in dynamic array

    OK thanks to both. I will look at storing in a worksheet or text file.

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,070

    Re: Storing values in dynamic array

    Glad to help & thanks for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Populate Dynamic Array from Cell Values and write to Dynamic Range
    By TFiske in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2018, 09:09 AM
  2. [SOLVED] Storing Array to Find Replace Value via 2 Dimensional Array
    By Matty5894 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-19-2016, 05:53 AM
  3. [SOLVED] Array not storing values that I've assigned to it.
    By EverGreen1231 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-08-2016, 11:14 AM
  4. [SOLVED] Storing different data value in an array
    By exlgh91 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-21-2013, 12:10 PM
  5. [SOLVED] Storing Range Values into Array
    By thewizz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2012, 01:18 PM
  6. Help in storing values to an array
    By crisshinn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2011, 04:53 PM
  7. Storing a vba lookup in an array
    By erikhs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-01-2006, 11:55 AM

Tags for this Thread

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