+ Reply to Thread
Results 1 to 2 of 2

Creating an Array with Names instead of Index Numbers

Hybrid View

  1. #1
    Registered User
    Join Date
    05-26-2010
    Location
    Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    6

    Creating an Array with Names instead of Index Numbers

    In c# .net I can create and array with using the name like arrayNames("John") = "john@me.com" but in excel VBA I cant find any documents that say this is possible as everything seems to reference the index number of the array. Basically what I am trying to do is read in settings for the excel file from the settings Worksheet I created so we a new column is added, the setting is automatically read into the application with the name of it. So then when I want to know the value of setting ABC I can just call arrayNames("John"). Is this possible?

    Example:
    arraySettings("AddRanking") = "Yes"
    arraySettings("HighlightOverages") = "No"
    
    if arraySettings("AddRanking") = "Yes" then
         ' # They want to add the ranking of the user so process that code
         if arraySettings("HighlightOverages") = "Yes"
              ' # They want highlight any overages so lets start to highlight
         end if
    end if

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Creating an Array with Names instead of Index Numbers

    Try using a collection instead.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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