+ Reply to Thread
Results 1 to 8 of 8

Array Variant

  1. #1
    Registered User
    Join Date
    04-01-2014
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    8

    Array Variant

    Hi
    To avoid users replacing or altering tables I replace this 'key' data from VBA as protection and hiding is not available in my environment.
    I have the data stored as multiple array Variants which are placed to the appropriate locations using loops to get all items.
    I would like to have a list of the variant arrays and have one loop that changes the array title.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Array Variant

    You really need to show us some code. Arrays don't have titles they are just groups of data

  3. #3
    Registered User
    Join Date
    04-01-2014
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    8

    Re: Array Variant

    I know that the below doesn't work (obviously) but hopefully you can see what I am trying to do:
    not sure I understand how this should be insterted correctly as code apologies if its wrong:
    Please Login or Register  to view this content.

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Array Variant

    No, not really clear what you're trying to do, but try changing:
    Please Login or Register  to view this content.
    To
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-01-2014
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    8

    Re: Array Variant

    ok sorry I will try to be clearer. I am trying to rebuild a table of data as it cannot be imported, or left as sticky fingers change details.
    so I have arrays 1 to 15 labelled as vArr1 to vArr15.
    then there is the container which holds each of the array defined names vArrList.
    I wanted to create a single loop which would go through all of the items in vArr1 then vArr2 etc. however these can be variable in length.

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Array Variant


    Hi,

    you should Dim vArr(1 to 15) and then vArr(1) =

    Or if you want to waste ressource for a variable like vArrList then you must remove double quotes in its array
    like the post of Kyle !
    Last edited by Marc L; 10-06-2014 at 08:52 AM.

  7. #7
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Array Variant

    Lose the first Debug.Print and it should work.

  8. #8
    Registered User
    Join Date
    04-01-2014
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    8

    Re: Array Variant

    Brilliant thanks very much chaps, removing the quotes works, now to reconfigure to attempts Marc L's directive!

+ 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. Variant vs Array
    By Kyle123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-26-2012, 09:45 AM
  2. Array problem: Key words-Variant Array, single-element, type mismatch error
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-09-2005, 01:54 AM
  3. Array problem: Key words-Variant Array, single-element, type mismatch error
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2005, 12:30 AM
  4. [SOLVED] Moving a Variant to Array
    By Ivan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-07-2005, 08:05 AM
  5. ReDim Object array as parameter of Variant array
    By Peter T in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-10-2005, 10:06 AM

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