+ Reply to Thread
Results 1 to 4 of 4

Storing variables as string or as variables in array performance

  1. #1
    Forum Contributor
    Join Date
    02-05-2015
    Location
    czech
    MS-Off Ver
    2010
    Posts
    172

    Storing variables as string or as variables in array performance

    Hello Dear Excel Help Forum

    I would like to know what is better approach to store set of variables.
    a) Is it better to store name of variables or object names in string array or b) rather store the objects themselves in variant array?

    Is there some overhead when converting name string to object reference or both approaches has same performance? (on nanosecond scale)

  2. #2
    Forum Contributor
    Join Date
    02-09-2009
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    380

    Re: Storing variables as string or as variables in array performance

    Sorry I don't understand your question fully. What exactly are you trying to do as I think this will determine your chosen method.

    No matter what if you're going to be manipulating object variables there must be overhead playing around with the strings surely.
    If it's been helpful please mark as helpful

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Storing variables as string or as variables in array performance

    I suspect the OP comes from C based languages. The OP is thinking in terms of Boxing and Unboxing objects.
    VBA does not have complex data structures- unlike C++ or C#,VBA has a simple Arrays and Dictionary structures.

  4. #4
    Forum Contributor
    Join Date
    02-05-2015
    Location
    czech
    MS-Off Ver
    2010
    Posts
    172

    Re: Storing variables as string or as variables in array performance

    To clarify what I mean:

    a)
    Please Login or Register  to view this content.
    b)
    Please Login or Register  to view this content.
    I'm interested what is faster and what takes more memory when populating array, traversing the populated array and operating on each element of the array.

+ 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] MS-Word storing variables in VBA (non-Excel)
    By HeyInKy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-04-2015, 09:42 AM
  2. [SOLVED] finding an output from 5 variables in an array using exterior input user variables
    By Allsort in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-09-2013, 11:16 AM
  3. Handling and storing values on global variables while running several macros
    By Pichingualas in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-23-2012, 10:55 AM
  4. Storing variables from a Userform in an Add In
    By solnajeff in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-01-2012, 12:56 PM
  5. passing a string array and string variables to sub
    By Lokesh_g in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-04-2010, 09:26 PM
  6. Storing Variables for use in different Sub routines
    By tomlancaster in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2010, 08:11 AM
  7. Storing and using objects in variables.
    By h20skee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-16-2008, 06:36 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