+ Reply to Thread
Results 1 to 5 of 5

Reference an object via a string (Convert a string to an objejct reference

  1. #1
    Registered User
    Join Date
    06-19-2013
    Location
    Chicago, United States of America
    MS-Off Ver
    Excel 2010
    Posts
    35

    Reference an object via a string (Convert a string to an objejct reference

    Hey All,

    I currently have a program in which I have 12 lists (list_1, list_2, list_3...). I am iterating through some data, and, based on some criteria, the data goes into one of the 12 lists.

    While iterating through the data, I have a counter that goes from 1 to 12 that indicates which list the data should go into.

    Obviously, I could hard code all 12 lists; however, is there a way I could use a string to reference the list?


    Example of what I am attempting to do. (NOTE: I do not want to hard code each of the 12 lists):

    Please Login or Register  to view this content.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Reference an object via a string (Convert a string to an objejct reference

    what are the lists - listboxes,variables,arrays? if they're controls, where are they?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    06-19-2013
    Location
    Chicago, United States of America
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Reference an object via a string (Convert a string to an objejct reference

    I'm currently just storing integers in the lists

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Reference an object via a string (Convert a string to an objejct reference

    But what exactly are the 'lists'?

    Are the listobjects on a worksheet? Arrays? Collections? Dictionaries? Ranges?
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    06-19-2013
    Location
    Chicago, United States of America
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Reference an object via a string (Convert a string to an objejct reference

    Ah, sorry. More appropriately they are Arrays

+ 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] Calling string inside cell reference to reference another sheet.
    By {=OR(value=array)} in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-26-2013, 04:45 PM
  2. String and Value workbook reference
    By jsp_1951 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 10-16-2013, 10:31 PM
  3. [SOLVED] How to use a String to reference to a CheckBox object?
    By excelnewbie80 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2012, 03:59 AM
  4. Convert string into a cell reference in a formula
    By seaottr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-03-2011, 07:10 PM
  5. Convert object as string
    By LTA in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-22-2010, 09:20 AM
  6. Convert a string to cell reference in VBA
    By Iswarya in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-17-2010, 02:34 AM
  7. Convert cell reference to text string
    By packe in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-08-2007, 09:56 AM
  8. [SOLVED] how do I convert text string into a cell reference
    By Dave Davis in forum Excel General
    Replies: 2
    Last Post: 07-22-2005, 05:05 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